Commit fe82d72797b3dbe1fdb76dc393cadbdc4a7dab19

  • avatar
  • swiesner <swiesner @283d02a7-25f6-0310…ecb5cbfe19da.>
  • Wed Aug 04 18:50:39 CEST 2010
Added property and configuration setting for two-finger emulation width

git-svn-id: svn+ssh://svn.kde.org/home/kde/trunk/playground/utils/synaptiks@1159179 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
  
136136 <method name="setTwoFingerEmulationMinimumPressure">
137137 <arg type="i" direction="in"/>
138138 </method>
139 <method name="twoFingerEmulationMinimumWidth">
140 <arg type="i" direction="out"/>
141 </method>
142 <method name="setTwoFingerEmulationMinimumWidth">
143 <arg type="i" direction="in"/>
144 </method>
139145 <method name="fastTaps">
140146 <arg type="b" direction="out"/>
141147 </method>
  
277277 // tapping configuration
278278 << "FastTaps" << "TapAndDragGesture" << "LockedDrags"
279279 // two finger emulation
280 << "TwoFingerEmulationMinimumPressure";
280 << "TwoFingerEmulationMinimumPressure"
281 << "TwoFingerEmulationMinimumWidth";
281282 foreach (const QString &name, names) {
282283 KConfigSkeletonItem *item = d->config->findItem(name);
283284 Q_ASSERT(item);
333333 // tapping configuration
334334 << "FastTaps" << "TapAndDragGesture" << "LockedDrags"
335335 // two finger emulation
336 << "TwoFingerEmulationMinimumPressure";
336 << "TwoFingerEmulationMinimumPressure"
337 << "TwoFingerEmulationMinimumWidth";
337338 foreach (const QString &name, names) {
338339 KConfigSkeletonItem *item = d->config->findItem(name);
339340 Q_ASSERT(item);
  
5252static const char SCROLLING_DISTANCE[] = "Synaptics Scrolling Distance";
5353static const char TAP_ACTION[] = "Synaptics Tap Action";
5454static const char TWO_FINGER_PRESSURE[] = "Synaptics Two-Finger Pressure";
55static const char TWO_FINGER_WIDTH[] = "Synaptics Two-Finger Width";
5556static const char FAST_TAP[] = "Synaptics Tap FastTap";
5657static const char CIRCULAR_PAD[] = "Synaptics Circular Pad";
5758static const char CAPABILITIES[] = "Synaptics Capabilities";
378378void Touchpad::setTwoFingerEmulationMinimumPressure(int pressure) {
379379 Q_D(Touchpad);
380380 d->device->setProperty(TWO_FINGER_SCROLLING, pressure);
381}
382
383int Touchpad::twoFingerEmulationMinimumWidth() const {
384 Q_D(const Touchpad);
385 return d->device->property<int>(TWO_FINGER_WIDTH, 0);
386}
387
388void Touchpad::setTwoFingerEmulationMinimumWidth(int width) {
389 Q_D(Touchpad);
390 d->device->setProperty(TWO_FINGER_WIDTH, width);
381391}
382392
383393bool Touchpad::fastTaps() const {
  
532532 DESIGNABLE false)
533533
534534 /**
535 * @brief Minimum with of a touch to be recognized as two-finger touch.
536 *
537 * Some touchpads report two-finger touches as "wide" finger
538 * touches. This property sets the minimum width of a touch to
539 * create a two-finger touch. Only if a "wide" touch is wider than
540 * the threshold configured by this property, a two-finger press is
541 * issued by the driver.
542 *
543 * @see setTwoFingerEmulationMinimumWidth(int)
544 * @see twoFingerEmulationMinimumWidth() const
545 * @see capabilities
546 * @see fingerDetection
547 */
548 Q_PROPERTY(int twoFingerEmulationMinimumWidth
549 READ twoFingerEmulationMinimumWidth
550 WRITE setTwoFingerEmulationMinimumWidth
551 DESIGNABLE false)
552
553 /**
535554 * @brief Whether or not fast tapping is enabled.
536555 *
537556 * Fast tapping makes the driver react faster on single taps, but
11521152 * @see twoFingerEmulationMinimumPressure
11531153 */
11541154 Q_SCRIPTABLE void setTwoFingerEmulationMinimumPressure(int);
1155
1156 /**
1157 * @brief The width threshold to emulate a two-finger press.
1158 *
1159 * @see twoFingerEmulationMinimumWidth
1160 */
1161 Q_SCRIPTABLE int twoFingerEmulationMinimumWidth() const;
1162
1163 /**
1164 * @brief Set the width threshold to emulate a two-finger press.
1165 *
1166 * @see twoFingerEmulationMinimumWidth
1167 */
1168 Q_SCRIPTABLE void setTwoFingerEmulationMinimumWidth(int);
11551169
11561170 /**
11571171 * @brief Whether fast taps are enabled.
  
253253 pressure);
254254}
255255
256int TouchpadAdaptor::twoFingerEmulationMinimumWidth() const {
257 return this->propertyOrDBusError(
258 "twoFingerEmulationMinimumWidth").toInt();
259}
260
261void TouchpadAdaptor::setTwoFingerEmulationMinimumWidth(int width) {
262 this->setPropertyOrDBusError("twoFingerEmulationMinimumWidth", width);
263}
264
256265bool TouchpadAdaptor::fastTaps() const {
257266 return this->propertyOrDBusError("fastTaps").toBool();
258267}
  
119119 int twoFingerEmulationMinimumPressure() const;
120120 void setTwoFingerEmulationMinimumPressure(int);
121121
122 int twoFingerEmulationMinimumWidth() const;
123 void setTwoFingerEmulationMinimumWidth(int);
124
122125 bool fastTaps() const;
123126 void setFastTaps(bool enabled);
124127
  
156156 <label>Minimum pressure to emulate a two-finger press</label>
157157 <default>150</default>
158158 </entry>
159 <entry name="TwoFingerEmulationMinimumWidth" type="Int">
160 <label>Minimum width to emulate a two-finger press</label>
161 <default>10</default>
162 </entry>
159163 </group>
160164 <group name="Tapping">
161165 <entry name="$(Corner)CornerButton" type="Enum">