diff options
author | Thomas Hindoe Paaboel Andersen <phomes@gmail.com> | 2015-01-20 00:44:40 +0100 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2015-08-27 14:59:27 +1000 |
commit | 034be31159f22ce28d84994d541a45ee44963fd8 (patch) | |
tree | 1cd4d585e116197d5ff282c6285cd4818e2f6d5a /src/emuThird.c | |
parent | Add the default evdev config (diff) | |
download | xf86-input-evdev-034be31159f22ce28d84994d541a45ee44963fd8.tar.gz xf86-input-evdev-034be31159f22ce28d84994d541a45ee44963fd8.tar.bz2 xf86-input-evdev-034be31159f22ce28d84994d541a45ee44963fd8.zip |
Add "Resolution" option for mice to the evdev driver
It can be used to scale the resolution of a mouse to that of a 1000 DPI
mouse. This can be useful to make high resolution mice less sensitive
without turning off acceleration. The target of 1000 DPI is used as the
same default is used in libinput. If the option is not set no scaling
will be done.
https://bugs.freedesktop.org/show_bug.cgi?id=88134
Signed-off-by: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/emuThird.c')
-rw-r--r-- | src/emuThird.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/emuThird.c b/src/emuThird.c index 7461767..5f14d33 100644 --- a/src/emuThird.c +++ b/src/emuThird.c @@ -229,8 +229,8 @@ Evdev3BEmuProcessAbsMotion(InputInfoPtr pInfo, ValuatorMask *vals) { if (valuator_mask_isset(vals, axis)) { - int delta = valuator_mask_get(vals, axis) - emu3B->startpos[axis]; - if (abs(delta) > emu3B->threshold) + double delta = valuator_mask_get_double(vals, axis) - emu3B->startpos[axis]; + if (fabs(delta) > emu3B->threshold) cancel = TRUE; } axis++; @@ -248,7 +248,7 @@ Evdev3BEmuProcessAbsMotion(InputInfoPtr pInfo, ValuatorMask *vals) * emulation. */ void -Evdev3BEmuProcessRelMotion(InputInfoPtr pInfo, int dx, int dy) +Evdev3BEmuProcessRelMotion(InputInfoPtr pInfo, double dx, double dy) { EvdevPtr pEvdev = pInfo->private; struct emulate3B *emu3B = &pEvdev->emulate3B; @@ -260,8 +260,8 @@ Evdev3BEmuProcessRelMotion(InputInfoPtr pInfo, int dx, int dy) emu3B->delta[1] += dy; emu3B->flags |= EVDEV_RELATIVE_EVENTS; - if (abs(emu3B->delta[0]) > emu3B->threshold || - abs(emu3B->delta[1]) > emu3B->threshold) + if (fabs(emu3B->delta[0]) > emu3B->threshold || + fabs(emu3B->delta[1]) > emu3B->threshold) { Evdev3BEmuPostButtonEvent(pInfo, 1, BUTTON_PRESS); Evdev3BCancel(pInfo); |