[PATCH:xf86-input-mouse 4/4] For wsmouse, keep 3-button emulation status.

Thomas Klausner wiz at NetBSD.org
Mon Aug 19 02:14:33 PDT 2013


With a multiplexed device like wsmouse it does not make sense to
kill emulate3buttons on the first button-3-pressed event. The
button-3 pressed may belong to a mouse long gone and leave the
internal (two button only) mousepad useless.

>From Martin Husemann <martin at NetBSD.org>
Signed-off-by: Thomas Klausner <wiz at NetBSD.org>
---
 src/mouse.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/mouse.c b/src/mouse.c
index 4797160..89cccdd 100644
--- a/src/mouse.c
+++ b/src/mouse.c
@@ -2057,6 +2057,17 @@ Emulate3ButtonsSoft(InputInfoPtr pInfo)
     if (!pMse->emulate3ButtonsSoft)
         return TRUE;
 
+#if defined(__NetBSD__) && defined(WSCONS_SUPPORT)
+   /*
+    * On NetBSD a wsmouse is a multiplexed device. Imagine a notebook
+    * with two-button mousepad, and an external USB mouse plugged in
+    * temporarily. After using button 3 on the external mouse and
+    * unplugging it again, the mousepad will still need to emulate
+    * 3 buttons.
+    */
+   return TRUE;
+#endif
+
     LogMessageVerbSigSafe(X_INFO, 4, "mouse: 3rd Button detected: disabling emulate3Button\n");
 
     Emulate3ButtonsSetEnabled(pInfo, FALSE);
-- 
1.8.3.3



More information about the xorg-devel mailing list