Commit c8323b8dee40c16ceb9110f6881bcada194e179a

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

git-svn-id: svn+ssh://svn.kde.org/home/kde/trunk/playground/utils/synaptiks@1159178 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
  
130130 <method name="setFingerButtons">
131131 <arg name="buttons" type="ay" direction="in"/>
132132 </method>
133 <method name="twoFingerEmulationMinimumPressure">
134 <arg type="i" direction="out"/>
135 </method>
136 <method name="setTwoFingerEmulationMinimumPressure">
137 <arg type="i" direction="in"/>
138 </method>
133139 <method name="fastTaps">
134140 <arg type="b" direction="out"/>
135141 </method>
  
275275 << "HorizontalScrollingDistance" << "VerticalScrollingDistance"
276276 << "CornerCoasting"
277277 // tapping configuration
278 << "FastTaps" << "TapAndDragGesture" << "LockedDrags";
278 << "FastTaps" << "TapAndDragGesture" << "LockedDrags"
279 // two finger emulation
280 << "TwoFingerEmulationMinimumPressure";
279281 foreach (const QString &name, names) {
280282 KConfigSkeletonItem *item = d->config->findItem(name);
281283 Q_ASSERT(item);
330330 << "HorizontalScrollingDistance" << "VerticalScrollingDistance"
331331 << "CornerCoasting" << "CoastingSpeed"
332332 // tapping configuration
333 << "FastTaps" << "TapAndDragGesture" << "LockedDrags";
333 << "FastTaps" << "TapAndDragGesture" << "LockedDrags"
334 // two finger emulation
335 << "TwoFingerEmulationMinimumPressure";
334336 foreach (const QString &name, names) {
335337 KConfigSkeletonItem *item = d->config->findItem(name);
336338 Q_ASSERT(item);
  
5151static const char COASTING_SPEED[] = "Synaptics Coasting Speed";
5252static const char SCROLLING_DISTANCE[] = "Synaptics Scrolling Distance";
5353static const char TAP_ACTION[] = "Synaptics Tap Action";
54static const char TWO_FINGER_PRESSURE[] = "Synaptics Two-Finger Pressure";
5455static const char FAST_TAP[] = "Synaptics Tap FastTap";
5556static const char CIRCULAR_PAD[] = "Synaptics Circular Pad";
5657static const char CAPABILITIES[] = "Synaptics Capabilities";
367367 QList<uchar> values = d->device->property<uchar>(TAP_ACTION);
368368 std::copy(buttons.begin(), buttons.begin()+3, values.begin()+4);
369369 return d->device->setProperty(TAP_ACTION, values);
370}
371
372int Touchpad::twoFingerEmulationMinimumPressure() const {
373 Q_D(const Touchpad);
374 return d->device->property<int>(TWO_FINGER_SCROLLING, 0);
375}
376
377void Touchpad::setTwoFingerEmulationMinimumPressure(int pressure) {
378 Q_D(Touchpad);
379 d->device->setProperty(TWO_FINGER_SCROLLING, pressure);
370380}
371381
372382bool Touchpad::fastTaps() const {
  
514514 DESIGNABLE false)
515515
516516 /**
517 * @brief Minimum pressure for two finger press emulation.
518 *
519 * For touchpads, that are not capable of detecting multiple
520 * fingers, this property sets the minimum pressure to emulate a two
521 * finger press. If the pressure exceeds the value configured for
522 * this property, the touchpad driver issues a two finger press.
523 *
524 * @see setTwoFingerEmulationMinimumPressure(int)
525 * @see twoFingerEmulationMinimumPressure() const
526 * @see capabilities
527 * @see fingerDetection
528 */
529 Q_PROPERTY(int twoFingerEmulationMinimumPressure
530 READ twoFingerEmulationMinimumPressure
531 WRITE setTwoFingerEmulationMinimumPressure
532 DESIGNABLE false)
533
534 /**
517535 * @brief Whether or not fast tapping is enabled.
518536 *
519537 * Fast tapping makes the driver react faster on single taps, but
11191119 * @see fingerButtons
11201120 */
11211121 Q_SCRIPTABLE void setFingerButtons(const QByteArray &buttons);
1122
1123 /**
1124 * @brief The pressure threshold to emulate a two finger press.
1125 *
1126 * @see twoFingerEmulationMinimumPressure
1127 */
1128 Q_SCRIPTABLE int twoFingerEmulationMinimumPressure() const;
1129
1130 /**
1131 * @brief Set the pressure threshold to emulate a two finger press.
1132 *
1133 * @see twoFingerEmulationMinimumPressure
1134 */
1135 Q_SCRIPTABLE void setTwoFingerEmulationMinimumPressure(int);
11221136
11231137 /**
11241138 * @brief Whether fast taps are enabled.
  
243243 }
244244}
245245
246int TouchpadAdaptor::twoFingerEmulationMinimumPressure() const {
247 return this->propertyOrDBusError(
248 "twoFingerEmulationMinimumPressure").toInt();
249}
250
251void TouchpadAdaptor::setTwoFingerEmulationMinimumPressure(int pressure) {
252 this->setPropertyOrDBusError("twoFingerEmulationMinimumPressure",
253 pressure);
254}
255
246256bool TouchpadAdaptor::fastTaps() const {
247257 return this->propertyOrDBusError("fastTaps").toBool();
248258}
  
116116 QByteArray fingerButtons() const;
117117 void setFingerButtons(const QByteArray &buttons);
118118
119 int twoFingerEmulationMinimumPressure() const;
120 void setTwoFingerEmulationMinimumPressure(int);
121
119122 bool fastTaps() const;
120123 void setFastTaps(bool enabled);
121124
  
152152scrolling event.</label>
153153 <default>20</default>
154154 </entry>
155 <entry name="TwoFingerEmulationMinimumPressure" type="Int">
156 <label>Minimum pressure to emulate a two-finger press</label>
157 <default>150</default>
158 </entry>
155159 </group>
156160 <group name="Tapping">
157161 <entry name="$(Corner)CornerButton" type="Enum">