From 103cabe97982a290eccfb684685e56298cbf13a6 Mon Sep 17 00:00:00 2001 From: John Pham Date: Sun, 29 Dec 2013 11:05:06 -0500 Subject: [PATCH 2/2] TouchpadOff=3 now disables touchpad motion only synclient and syndaemon updated to allow this --- src/properties.c | 2 +- src/synaptics.c | 3 ++- src/synapticsstr.h | 2 ++ tools/syndaemon.c | 14 ++++++++++---- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/properties.c b/src/properties.c index 797f1da..4623f42 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 d0a6c48..b7ea0c2 100644 --- a/src/synaptics.c +++ b/src/synaptics.c @@ -2898,8 +2898,9 @@ 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 != TOUCHPAD_MOTION_OFF)){ xf86PostMotionEvent(pInfo->dev, 0, 0, 2, dx, dy); + } if (priv->mid_emu_state == MBE_LEFT_CLICK) { post_button_click(pInfo, 1); diff --git a/src/synapticsstr.h b/src/synapticsstr.h index a9901a2..2b5c474 100644 --- a/src/synapticsstr.h +++ b/src/synapticsstr.h @@ -59,6 +59,7 @@ enum OffState { TOUCHPAD_ON = 0, TOUCHPAD_OFF = 1, TOUCHPAD_TAP_OFF = 2, + TOUCHPAD_MOTION_OFF = 3 }; enum TapEvent { @@ -172,6 +173,7 @@ typedef struct _SynapticsParameters { * 0 : Not off * 1 : Off * 2 : Only tapping and scrolling off + * 3 : Only motion off */ Bool locked_drags; /* Enable locked drags */ int locked_drag_time; /* timeout for locked drags */ diff --git a/tools/syndaemon.c b/tools/syndaemon.c index 8b782b3..9b755ad 100644 --- a/tools/syndaemon.c +++ b/tools/syndaemon.c @@ -50,7 +50,8 @@ enum TouchpadState { TouchpadOn = 0, TouchpadOff = 1, - TappingOff = 2 + TappingOff = 2, + MotionOff = 3 }; static Bool pad_disabled @@ -78,7 +79,7 @@ static void usage(void) { fprintf(stderr, - "Usage: syndaemon [-i idle-time] [-m poll-delay] [-d] [-t] [-k]\n"); + "Usage: syndaemon [-i idle-time] [-m poll-delay] [-d] [-t mode] [-k]\n"); fprintf(stderr, " -i How many seconds to wait after the last key press before\n"); fprintf(stderr, " enabling the touchpad. (default is 2.0s)\n"); @@ -87,7 +88,9 @@ usage(void) fprintf(stderr, " -d Start as a daemon, i.e. in the background.\n"); fprintf(stderr, " -p Create a pid file with the specified name.\n"); fprintf(stderr, - " -t Only disable tapping and scrolling, not mouse movements.\n"); + " -t Disable state. 1 for disabling touchpad entirely, \n" + " 2 for disabling tapping and scrolling only,\n" + " 3 for disabling motion only.\n"); fprintf(stderr, " -k Ignore modifier keys when monitoring keyboard activity.\n"); fprintf(stderr, " -K Like -k but also ignore Modifier+Key combos.\n"); @@ -667,7 +670,10 @@ main(int argc, char *argv[]) background = 1; break; case 't': - disable_state = TappingOff; + disable_state = atoi(optarg); + if(disable_state > MotionOff){ + usage(); + } break; case 'p': pid_file = optarg; -- 1.8.3.2