synaptics: Add TouchpadOff=3 to disable pointer motion only

Submitted by Andy Lutomirski on Jan. 30, 2013, 4:21 a.m.

Details

Message ID 55d89e2c1dfbdb4f7eb15867513607ba9763ec7e.1359518468.git.luto@amacapital.net
State New
Headers show

Not browsing as part of any series.

Commit Message

Andy Lutomirski Jan. 30, 2013, 4:21 a.m.
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@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(-)

Patch hide | download patch | download mbox

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) {

Comments

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@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@lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
>
On Wed, Jan 30, 2013 at 2:57 PM, Peter Hutterer
<peter.hutterer@who-t.net> wrote:
> 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@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?

That seems to work.  The docs are a bit misleading IMO, though -- this
decelerates by a factor much more than 50.

Are there any easy-to-use hotplug-aware tools for setting XI2
properties on a per-device basis?  Doing this in xorg.conf seems kind
of sad.

--Andy
On 2/02/13 03:38 , Andy Lutomirski wrote:
> On Wed, Jan 30, 2013 at 2:57 PM, Peter Hutterer
> <peter.hutterer@who-t.net> wrote:
>> 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@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?
>
> That seems to work.  The docs are a bit misleading IMO, though -- this
> decelerates by a factor much more than 50.
>
> Are there any easy-to-use hotplug-aware tools for setting XI2
> properties on a per-device basis?  Doing this in xorg.conf seems kind
> of sad.

why? that's what the InputClass sections were designed for - give you 
configuration that works on a class of devices, even when hotplugged.

your desktop environment could handle this in the client, but afaik none 
of the major ones currently do set this particular setting.

so putting a snippet in xorg.conf.d is certainly the best and most 
appropriate solution.

Cheers,
   Peter
On Fri, Feb 1, 2013 at 3:22 PM, Peter Hutterer <peter.hutterer@who-t.net> wrote:
> On 2/02/13 03:38 , Andy Lutomirski wrote:
>>
>> On Wed, Jan 30, 2013 at 2:57 PM, Peter Hutterer
>> <peter.hutterer@who-t.net> wrote:
>>>
>>> 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@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?
>>
>>
>> That seems to work.  The docs are a bit misleading IMO, though -- this
>> decelerates by a factor much more than 50.
>>
>> Are there any easy-to-use hotplug-aware tools for setting XI2
>> properties on a per-device basis?  Doing this in xorg.conf seems kind
>> of sad.
>
>
> why? that's what the InputClass sections were designed for - give you
> configuration that works on a class of devices, even when hotplugged.

Privilege.  Editing xorg.conf requires root; setting XI2 properties does not.

>
> your desktop environment could handle this in the client, but afaik none of
> the major ones currently do set this particular setting.

If GNOME ever adds detailed controls like this, I'll be amazed :/

--Andy
On 2/02/13 09:28 , Andy Lutomirski wrote:
> On Fri, Feb 1, 2013 at 3:22 PM, Peter Hutterer <peter.hutterer@who-t.net> wrote:
>> On 2/02/13 03:38 , Andy Lutomirski wrote:
>>>
>>> On Wed, Jan 30, 2013 at 2:57 PM, Peter Hutterer
>>> <peter.hutterer@who-t.net> wrote:
>>>>
>>>> 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@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?
>>>
>>>
>>> That seems to work.  The docs are a bit misleading IMO, though -- this
>>> decelerates by a factor much more than 50.
>>>
>>> Are there any easy-to-use hotplug-aware tools for setting XI2
>>> properties on a per-device basis?  Doing this in xorg.conf seems kind
>>> of sad.
>>
>>
>> why? that's what the InputClass sections were designed for - give you
>> configuration that works on a class of devices, even when hotplugged.
>
> Privilege.  Editing xorg.conf requires root; setting XI2 properties does not.

fair enough.

>> your desktop environment could handle this in the client, but afaik none of
>> the major ones currently do set this particular setting.
>
> If GNOME ever adds detailed controls like this, I'll be amazed :/

http://who-t.blogspot.com.au/2011/03/custom-input-device-configuration-in.html

no GUI, but it'll get the job done.

Cheers,
   Peter