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

Peter Hutterer peter.hutterer at who-t.net
Wed Jan 30 14:57:35 PST 2013


On Tue, Jan 29, 2013 at 08:21:02PM -0800, Andy Lutomirski wrote:
> 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?

You should be able to get the same effect by setting ConstantDeceleration on
your device to something really high (50 or so will likely do). The touchpad
will still submit motion events, but x/y pointer movement will be slowed
down enough to never actually change.

would that work for you?

Cheers,
   Peter

> 
>  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
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
> 


More information about the xorg-devel mailing list