summaryrefslogtreecommitdiff
path: root/src/evdev.c
diff options
context:
space:
mode:
authorPeter De Wachter <pdewacht@gmail.com>2012-10-03 20:48:24 +0200
committerPeter Hutterer <peter.hutterer@who-t.net>2013-10-21 15:47:54 +1000
commitc3251deb4b988610c3766081345e49f538fca865 (patch)
treef4b5ae815d9d4df9c1eece7c5f6710cb45cfa0e6 /src/evdev.c
parentcabed4bbb6757e55f067126965f26bb0f716fb55 (diff)
Add configuration options for smooth scrolling.
This patch creates three new xorg.conf options, VertScrollDelta, HorizScrollDelta and DialDelta, which adjust the sensitivity of smooth scrolling. These options take a positive integer, default value is 1. Signed-off-by: Peter De Wachter <pdewacht@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/evdev.c')
-rw-r--r--src/evdev.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/src/evdev.c b/src/evdev.c
index 1aa92d2..812b177 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1533,7 +1533,8 @@ EvdevAddAbsValuatorClass(DeviceIntPtr device, int want_scroll_axes)
NO_AXIS_LIMITS, NO_AXIS_LIMITS,
0, 0, 0, Relative);
SetScrollValuator(device, pEvdev->rel_axis_map[idx],
- SCROLL_TYPE_VERTICAL, -1.0,
+ SCROLL_TYPE_VERTICAL,
+ -pEvdev->smoothScroll.vert_delta,
SCROLL_FLAG_PREFERRED);
}
@@ -1546,7 +1547,8 @@ EvdevAddAbsValuatorClass(DeviceIntPtr device, int want_scroll_axes)
NO_AXIS_LIMITS, NO_AXIS_LIMITS,
0, 0, 0, Relative);
SetScrollValuator(device, pEvdev->rel_axis_map[idx],
- SCROLL_TYPE_HORIZONTAL, 1.0,
+ SCROLL_TYPE_HORIZONTAL,
+ pEvdev->smoothScroll.horiz_delta,
SCROLL_FLAG_NONE);
}
@@ -1559,7 +1561,8 @@ EvdevAddAbsValuatorClass(DeviceIntPtr device, int want_scroll_axes)
NO_AXIS_LIMITS, NO_AXIS_LIMITS,
0, 0, 0, Relative);
SetScrollValuator(device, pEvdev->rel_axis_map[idx],
- SCROLL_TYPE_VERTICAL, -1.0,
+ SCROLL_TYPE_VERTICAL,
+ -pEvdev->smoothScroll.dial_delta,
SCROLL_FLAG_NONE);
}
}
@@ -1702,11 +1705,17 @@ EvdevAddRelValuatorClass(DeviceIntPtr device)
xf86InitValuatorDefaults(device, axnum);
#ifdef HAVE_SMOOTH_SCROLLING
if (axis == REL_WHEEL)
- SetScrollValuator(device, axnum, SCROLL_TYPE_VERTICAL, -1.0, SCROLL_FLAG_PREFERRED);
+ SetScrollValuator(device, axnum, SCROLL_TYPE_VERTICAL,
+ -pEvdev->smoothScroll.vert_delta,
+ SCROLL_FLAG_PREFERRED);
else if (axis == REL_DIAL)
- SetScrollValuator(device, axnum, SCROLL_TYPE_VERTICAL, -1.0, SCROLL_FLAG_NONE);
+ SetScrollValuator(device, axnum, SCROLL_TYPE_VERTICAL,
+ -pEvdev->smoothScroll.dial_delta,
+ SCROLL_FLAG_NONE);
else if (axis == REL_HWHEEL)
- SetScrollValuator(device, axnum, SCROLL_TYPE_HORIZONTAL, 1.0, SCROLL_FLAG_NONE);
+ SetScrollValuator(device, axnum, SCROLL_TYPE_HORIZONTAL,
+ pEvdev->smoothScroll.horiz_delta,
+ SCROLL_FLAG_NONE);
#endif
}
@@ -2329,6 +2338,15 @@ EvdevProbe(InputInfoPtr pInfo)
xf86IDrvMsg(pInfo, X_INFO, "Adding scrollwheel support\n");
pEvdev->flags |= EVDEV_BUTTON_EVENTS;
pEvdev->flags |= EVDEV_RELATIVE_EVENTS;
+
+#ifdef HAVE_SMOOTH_SCROLLING
+ pEvdev->smoothScroll.vert_delta =
+ xf86SetIntOption(pInfo->options, "VertScrollDelta", 1);
+ pEvdev->smoothScroll.horiz_delta =
+ xf86SetIntOption(pInfo->options, "HorizScrollDelta", 1);
+ pEvdev->smoothScroll.dial_delta =
+ xf86SetIntOption(pInfo->options, "DialDelta", 1);
+#endif
}
out: