diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2010-05-28 09:47:17 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2010-05-31 11:01:26 +1000 |
commit | 21a2ac818e75ef918d320ce1e88b6263e68e598d (patch) | |
tree | 35abac3ad12f84520bfd24260019a63c6e56e30d /src/emuMB.c | |
parent | Remove libc wrappers for malloc, calloc and free. (diff) | |
download | xf86-input-evdev-21a2ac818e75ef918d320ce1e88b6263e68e598d.tar.gz xf86-input-evdev-21a2ac818e75ef918d320ce1e88b6263e68e598d.tar.bz2 xf86-input-evdev-21a2ac818e75ef918d320ce1e88b6263e68e598d.zip |
Disable middle mouse button emulation by default.
The AUTO feature was the default, MB emulation was on until a middle mouse
button was pressed. MB emulation however results in a delay of the first
press, causing minor annoyances to the users and being generally confusing
when the behaviour before a button press is different to after a button
pres.
Disable the feature by default instead. There's not a lot of two-button mice
around anymore though and the inability to detect two-button mice makes for
non-deterministic detection of when the emulation should be on.
Middle button emulation can be enabled with a configuration snippet:
Section "InputClass"
Identifier "middle button emulation"
MatchIsPointer "on"
Option "Emulate3Buttons" "on"
EndSection
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'src/emuMB.c')
-rw-r--r-- | src/emuMB.c | 38 |
1 files changed, 3 insertions, 35 deletions
diff --git a/src/emuMB.c b/src/emuMB.c index c33ea8e..764b30e 100644 --- a/src/emuMB.c +++ b/src/emuMB.c @@ -43,12 +43,6 @@ #include <evdev-properties.h> -enum { - MBEMU_DISABLED = 0, - MBEMU_ENABLED, - MBEMU_AUTO -}; - #ifdef HAVE_PROPERTIES static Atom prop_mbemu = 0; /* Middle button emulation on/off property */ static Atom prop_mbtimeout = 0; /* Middle button timeout property */ @@ -232,11 +226,6 @@ EvdevMBEmuFilterEvent(InputInfoPtr pInfo, int button, BOOL press) if (!pEvdev->emulateMB.enabled) return ret; - if (button == 2) { - EvdevMBEmuEnable(pInfo, FALSE); - return ret; - } - /* don't care about other buttons */ if (button != 1 && button != 3) return ret; @@ -311,20 +300,9 @@ EvdevMBEmuPreInit(InputInfoPtr pInfo) { EvdevPtr pEvdev = (EvdevPtr)pInfo->private; - if (pEvdev->flags & EVDEV_TOUCHSCREEN) - pEvdev->emulateMB.enabled = MBEMU_DISABLED; - else - pEvdev->emulateMB.enabled = MBEMU_AUTO; - - if (xf86FindOption(pInfo->options, "Emulate3Buttons")) - { - pEvdev->emulateMB.enabled = xf86SetBoolOption(pInfo->options, - "Emulate3Buttons", - MBEMU_ENABLED); - xf86Msg(X_INFO, "%s: Forcing middle mouse button emulation %s.\n", - pInfo->name, (pEvdev->emulateMB.enabled) ? "on" : "off"); - } - + pEvdev->emulateMB.enabled = xf86SetBoolOption(pInfo->options, + "Emulate3Buttons", + FALSE); pEvdev->emulateMB.timeout = xf86SetIntOption(pInfo->options, "Emulate3Timeout", 50); } @@ -352,16 +330,6 @@ EvdevMBEmuFinalize(InputInfoPtr pInfo) } -/* Enable/disable middle mouse button emulation. */ -void -EvdevMBEmuEnable(InputInfoPtr pInfo, BOOL enable) -{ - EvdevPtr pEvdev = (EvdevPtr)pInfo->private; - if (pEvdev->emulateMB.enabled == MBEMU_AUTO) - pEvdev->emulateMB.enabled = enable; -} - - #ifdef HAVE_PROPERTIES static int EvdevMBEmuSetProperty(DeviceIntPtr dev, Atom atom, XIPropertyValuePtr val, |