Commit 0b5d6ba772cd7b80af72044bf3b15d46f1d2bb58

  • avatar
  • swiesner <swiesner @283d02a7-25f6-0310…ecb5cbfe19da.>
  • Thu Mar 11 19:49:07 CET 2010
FEATURE: Added scrolling speed settings
GUI: Added scrolling speed controls to scrolling page
Added verticalScrollingDistance and horizontalScrollingDistnance properties to Touchpad

git-svn-id: svn+ssh://svn.kde.org/home/kde/trunk/playground/utils/synaptiks@1102067 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
  
106106 <method name="setCoastingSpeed">
107107 <arg name="speed" type="d" direction="in"/>
108108 </method>
109 <method name="horizontalScrollingDistance">
110 <arg type="i" direction="out"/>
111 </method>
112 <method name="setHorizontalScrollingDistance">
113 <arg name="distance" type="i" direction="in"/>
114 </method>
115 <method name="verticalScrollingDistance">
116 <arg type="i" direction="out"/>
117 </method>
118 <method name="setVerticalScrollingDistance">
119 <arg name="distance" type="i" direction="in"/>
120 </method>
109121 <method name="cornerButtons">
110122 <arg type="ay" direction="out"/>
111123 </method>
  
245245 << "CircularScrolling" << "CircularScrollingTrigger"
246246 << "HorizontalTwoFingerScrolling" << "VerticalTwoFingerScrolling"
247247 << "HorizontalEdgeScrolling" << "VerticalEdgeScrolling"
248 << "HorizontalScrollingDistance" << "VerticalScrollingDistance"
248249 // tapping configuration
249250 << "FastTaps" << "TapAndDragGesture" << "LockedDrags";
250251 foreach (const QString &name, names) {
  
4949static const char TWO_FINGER_SCROLLING[] = "Synaptics Two-Finger Scrolling";
5050static const char EDGE_SCROLLING[] = "Synaptics Edge Scrolling";
5151static const char COASTING_SPEED[] = "Synaptics Coasting Speed";
52static const char SCROLLING_DISTANCE[] = "Synaptics Scrolling Distance";
5253static const char TAP_ACTION[] = "Synaptics Tap Action";
5354static const char FAST_TAP[] = "Synaptics Tap FastTap";
5455static const char CIRCULAR_PAD[] = "Synaptics Circular Pad";
7979 HorizontalScrollingItem = 1
8080};
8181
82enum ScrollingDistanceItem {
83 VerticalDistanceItem = 0,
84 HorizontalDistanceItem = 1,
85};
8286
87
8388using namespace synaptiks;
8489
8590
308308void Touchpad::setCoastingSpeed(float speed) {
309309 Q_D(Touchpad);
310310 return d->device->setProperty(COASTING_SPEED, speed);
311}
312
313int Touchpad::horizontalScrollingDistance() const {
314 Q_D(const Touchpad);
315 return d->device->property<int>(SCROLLING_DISTANCE,
316 HorizontalDistanceItem);
317}
318
319void Touchpad::setHorizontalScrollingDistance(int distance) {
320 Q_D(Touchpad);
321 d->device->setProperty<int>(SCROLLING_DISTANCE, distance,
322 HorizontalDistanceItem);
323}
324
325int Touchpad::verticalScrollingDistance() const {
326 Q_D(const Touchpad);
327 return d->device->property<int>(SCROLLING_DISTANCE,
328 VerticalDistanceItem);
329}
330
331void Touchpad::setVerticalScrollingDistance(int distance) {
332 Q_D(Touchpad);
333 d->device->setProperty<int>(SCROLLING_DISTANCE, distance,
334 VerticalDistanceItem);
311335}
312336
313337QByteArray Touchpad::cornerButtons() const {
  
393393 WRITE setCoastingSpeed DESIGNABLE false)
394394
395395 /**
396 * @brief The speed of horizontal scrolling.
397 *
398 * This property holds the move distance of the finger to generate a
399 * single horizontal scroll event.
400 *
401 * @see setHorizontalScrollingDistance(int)
402 * @see horizontalScrollingDistance() const
403 * @see horizontalEdgeScrolling
404 * @see horizontalTwoFingerScrolling
405 */
406 Q_PROPERTY(int horizontalScrollingDistance
407 READ horizontalScrollingDistance
408 WRITE setHorizontalScrollingDistance DESIGNABLE false)
409
410 /**
411 * @brief The speed of vertical scrolling.
412 *
413 * This property holds the move distance of the finger to generate a
414 * single vertical scroll event.
415 *
416 * @see setVerticalScrollingDistance(int)
417 * @see verticalScrollingDistance() const
418 * @see verticalEdgeScrolling
419 * @see verticalTwoFingerScrolling
420 */
421 Q_PROPERTY(int verticalScrollingDistance
422 READ verticalScrollingDistance
423 WRITE setVerticalScrollingDistance DESIGNABLE false)
424
425 /**
396426 * @brief The mouse buttons triggered by tapping the touchpad
397427 * corner.
398428 *
10171017 * @see coastingSpeed
10181018 */
10191019 Q_SCRIPTABLE void setCoastingSpeed(float speed);
1020
1021 /**
1022 * @brief Return the move distance of the finger to generate a
1023 * horizontal scroll event.
1024 *
1025 * @return the move distance for a horizontal scroll event
1026 * @see horizontalScrollingDistance
1027 */
1028 Q_SCRIPTABLE int horizontalScrollingDistance() const;
1029
1030 /**
1031 * @brief Set the move distance of the finger to generate a
1032 * horizontal scroll event.
1033 *
1034 * @param distance the move distance for a horizontal scroll event
1035 * @see horizontalScrollingDistance
1036 */
1037 Q_SCRIPTABLE void setHorizontalScrollingDistance(int distance);
1038
1039 /**
1040 * @brief Return the move distance of the finger to generate a
1041 * vertical scroll event.
1042 *
1043 * @return the move distance for a vertical scroll event
1044 * @see verticalScrollingDistance
1045 */
1046 Q_SCRIPTABLE int verticalScrollingDistance() const;
1047
1048 /**
1049 * @brief Set the move distance of the finger to generate a vertical
1050 * scroll event.
1051 *
1052 * @param distance the move distance for a vertical scroll event
1053 * @see verticalScrollingDistance
1054 */
1055 Q_SCRIPTABLE void setVerticalScrollingDistance(int distance);
10201056
10211057 /**
10221058 * @brief Query the mouse buttons triggered by tapping the touchpad
  
196196 this->setPropertyOrDBusError("coastingSpeed", speed);
197197}
198198
199int TouchpadAdaptor::horizontalScrollingDistance() const {
200 return this->propertyOrDBusError("horizontalScrollingDistance").toInt();
201}
202
203void TouchpadAdaptor::setHorizontalScrollingDistance(int distance) {
204 this->setPropertyOrDBusError("horizontalScrollingDistance", distance);
205}
206
207int TouchpadAdaptor::verticalScrollingDistance() const {
208 return this->propertyOrDBusError("verticalScrollingDistance").toInt();
209}
210
211void TouchpadAdaptor::setVerticalScrollingDistance(int distance) {
212 this->setPropertyOrDBusError("verticalScrollingDistance", distance);
213}
214
199215QByteArray TouchpadAdaptor::cornerButtons() const {
200216 return this->propertyOrDBusError("cornerButtons").toByteArray();
201217}
  
104104 double coastingSpeed() const;
105105 void setCoastingSpeed(double speed);
106106
107 int horizontalScrollingDistance() const;
108 void setHorizontalScrollingDistance(int distance);
109
110 int verticalScrollingDistance() const;
111 void setVerticalScrollingDistance(int distance);
112
107113 QByteArray cornerButtons() const;
108114 void setCornerButtons(const QByteArray &buttons);
109115
  
88 <x>0</x>
99 <y>0</y>
1010 <width>533</width>
11 <height>360</height>
11 <height>413</height>
1212 </rect>
1313 </property>
1414 <property name="windowTitle">
3737 </property>
3838 </widget>
3939 </item>
40 <item>
41 <widget class="KIntNumInput" name="kcfg_HorizontalScrollingDistance">
42 <property name="label">
43 <string comment="@label:slider">Scrolling speed</string>
44 </property>
45 <property name="minimum">
46 <number>1</number>
47 </property>
48 <property name="maximum">
49 <number>200</number>
50 </property>
51 <property name="singleStep">
52 <number>10</number>
53 </property>
54 <property name="sliderEnabled">
55 <bool>true</bool>
56 </property>
57 </widget>
58 </item>
4059 </layout>
4160 </widget>
4261 </item>
7979 </property>
8080 </widget>
8181 </item>
82 <item>
83 <widget class="KIntNumInput" name="kcfg_VerticalScrollingDistance">
84 <property name="label">
85 <string comment="@label:slider">Scrolling speed</string>
86 </property>
87 <property name="minimum">
88 <number>1</number>
89 </property>
90 <property name="maximum">
91 <number>200</number>
92 </property>
93 <property name="singleStep">
94 <number>10</number>
95 </property>
96 <property name="sliderEnabled">
97 <bool>true</bool>
98 </property>
99 </widget>
100 </item>
82101 </layout>
83102 </widget>
84103 </item>
257257 <class>KComboBox</class>
258258 <extends>QComboBox</extends>
259259 <header>kcombobox.h</header>
260 </customwidget>
261 <customwidget>
262 <class>KIntNumInput</class>
263 <extends>QWidget</extends>
264 <header>knuminput.h</header>
260265 </customwidget>
261266 </customwidgets>
262267 <resources/>
  
137137 <default>3.0</default>
138138 <min>0.01</min>
139139 </entry>
140 <entry name="HorizontalScrollingDistance" type="Int">
141 <label>The move distance of the finger to generate a horizontal
142scrolling event.</label>
143 <default>20</default>
144 </entry>
145 <entry name="VerticalScrollingDistance" type="Int">
146 <label>The move distance of the finger to generate a vertical
147scrolling event.</label>
148 <default>20</default>
149 </entry>
140150 </group>
141151 <group name="Tapping">
142152 <entry name="$(Corner)CornerButton" type="Enum">