diff options
author | Dima Kogan <dkogan@secretsauce.net> | 2009-08-16 23:11:50 -0700 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-08-18 13:09:33 +1000 |
commit | f4ba2bd785b25fd522967abd7775925d5fded70f (patch) | |
tree | 9150fa2363c0529ed1589571a9991f50655c7646 /src/emuWheel.c | |
parent | Restrict wheel emulation to a single axis at a time. (diff) | |
download | xf86-input-evdev-f4ba2bd785b25fd522967abd7775925d5fded70f.tar.gz xf86-input-evdev-f4ba2bd785b25fd522967abd7775925d5fded70f.tar.bz2 xf86-input-evdev-f4ba2bd785b25fd522967abd7775925d5fded70f.zip |
Allow 0 as wheel emulation button for unconditional scrolling (#20529)
If wheel emulation is on and the emulation button is 0, then any x/y motion
of the device is converted into wheel events. The devices becomes a
scrolling-only device.
Signed-off-by: Dima Kogan <dkogan@cds.caltech.edu>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/emuWheel.c')
-rw-r--r-- | src/emuWheel.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/emuWheel.c b/src/emuWheel.c index cc23f1d..178b01b 100644 --- a/src/emuWheel.c +++ b/src/emuWheel.c @@ -100,18 +100,20 @@ EvdevWheelEmuFilterMotion(InputInfoPtr pInfo, struct input_event *pEv) EvdevPtr pEvdev = (EvdevPtr)pInfo->private; WheelAxisPtr pAxis = NULL, pOtherAxis = NULL; int value = pEv->value; - int ms; /* Has wheel emulation been configured to be enabled? */ if (!pEvdev->emulateWheel.enabled) return FALSE; - /* Handle our motion events if the emuWheel button is pressed*/ - if (pEvdev->emulateWheel.button_state) { + /* Handle our motion events if the emuWheel button is pressed + * wheel button of 0 means always emulate wheel. + */ + if (pEvdev->emulateWheel.button_state || !pEvdev->emulateWheel.button) { /* Just return if the timeout hasn't expired yet */ - ms = pEvdev->emulateWheel.expires - GetTimeInMillis(); - if (ms > 0) + if (pEvdev->emulateWheel.button && + pEvdev->emulateWheel.expires - GetTimeInMillis() > 0) { return TRUE; + } /* We don't want to intercept real mouse wheel events */ switch(pEv->code) { |