From 39dc453691804648f34dbd856bd7e66cfdc59d66 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 10 Jun 2008 22:48:01 +0930 Subject: Disable middle mouse button emulation when a real middle MB event is detected. Devices may report middle mouse buttons even if they don't have one (PS/2 devices just don't know any better), so we can't be sure until we see the event. --- man/evdev.man | 4 ++-- src/evdev.c | 7 +------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/man/evdev.man b/man/evdev.man index b8807f0..f438f78 100644 --- a/man/evdev.man +++ b/man/evdev.man @@ -60,8 +60,8 @@ one of \*qPath\*q or \*qDevice\*q must be given. .BI "Option \*qEmulate3Buttons\*q \*q" boolean \*q Enable/disable the emulation of the third (middle) mouse button for mice which only have two physical buttons. The third button is emulated by -pressing both buttons simultaneously. Default: on, unless the device reports -the presence of a physical button 3. +pressing both buttons simultaneously. Default: on, until a middle mouse +button event is registered. .TP 7 .BI "Option \*qEmulate3Timeout\*q \*q" integer \*q Sets the timeout (in milliseconds) that the driver waits before deciding diff --git a/src/evdev.c b/src/evdev.c index 27d75dc..05eb760 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -226,6 +226,7 @@ EvdevReadInput(InputInfoPtr pInfo) xf86PostButtonEvent(pInfo->dev, 0, 3, value, 0, 0); break; case BTN_MIDDLE: + EvdevMBEmuEnable(pInfo, FALSE); xf86PostButtonEvent(pInfo->dev, 0, 2, value, 0, 0); break; @@ -943,12 +944,6 @@ EvdevProbe(InputInfoPtr pInfo) has_buttons = TRUE; } - if (TestBit(BTN_MIDDLE, key_bitmask)) { - xf86Msg(X_INFO, "%s: Found middle button. Disabling emulation.\n", - pInfo->name); - EvdevMBEmuEnable(pInfo, FALSE); - } - for (i = 0; i < BTN_MISC; i++) if (TestBit(i, key_bitmask)) break; -- cgit v1.2.3