[PATCH] synaptics: Add TouchpadOff=3 to disable pointer motion only

Andy Lutomirski luto at amacapital.net
Tue Jan 29 20:21:02 PST 2013


I have a Lenovo laptop with a trackpoint and a touchpad.  I much
prefer the trackpoint for moving the cursor, but the touchpad is
handy for two-finger scrolling.  The Windows driver allows a mode
with gestures only on the touchpad; add such a mode in Linux too.
(Leaving the touchpad fully enabled is no good; palm detection is
spotty at best.)

Signed-off-by: Andy Lutomirski <luto at amacapital.net>
---
I'm a little surprised that this apparently can't be done in the XI2
core.  Is there a better way?

 man/synaptics.man | 1 +
 src/properties.c  | 2 +-
 src/synaptics.c   | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/man/synaptics.man b/man/synaptics.man
index 03f18ac..5f9702a 100644
--- a/man/synaptics.man
+++ b/man/synaptics.man
@@ -228,6 +228,7 @@ l l.
 0	Touchpad is enabled
 1	Touchpad is switched off
 2	Only tapping and scrolling is switched off
+3	Only pointer motion is switched off
 .TE
 Property: "Synaptics Off"
 .TP
diff --git a/src/properties.c b/src/properties.c
index dd88fc7..cbaf480 100644
--- a/src/properties.c
+++ b/src/properties.c
@@ -526,7 +526,7 @@ SetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
 
         off = *(CARD8 *) prop->data;
 
-        if (off > 2)
+        if (off > 3)
             return BadValue;
 
         para->touchpad_off = off;
diff --git a/src/synaptics.c b/src/synaptics.c
index 29e551a..fff4ba1 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2866,7 +2866,7 @@ HandleState(InputInfoPtr pInfo, struct SynapticsHwState *hw, CARD32 now,
     }
 
     /* Post events */
-    if (finger >= FS_TOUCHED && (dx || dy))
+    if (finger >= FS_TOUCHED && (dx || dy)  && para->touchpad_off != 3)
         xf86PostMotionEvent(pInfo->dev, 0, 0, 2, dx, dy);
 
     if (priv->mid_emu_state == MBE_LEFT_CLICK) {
-- 
1.8.1



More information about the xorg-devel mailing list