summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Osterlund <petero2@telia.com>2005-01-02 21:34:40 +0100
committerPeter Osterlund <petero2@telia.com>2006-04-09 04:03:00 +0200
commit9f5ae2b7da6a6aa8ecd1bc5929700edb2caca9f7 (patch)
tree4dfad797848f1438b2a4b2afe5f6e6377092f0f1
parentdaac999d7fda93af07fb2403001a5bfe3a50de20 (diff)
Made it possible to disable tapping without disabling mouse
movements. Added -t switch to syndaemon to disable only tapping in response to keyboard activity.
-rw-r--r--README6
-rw-r--r--manpages/syndaemon.14
-rw-r--r--synaptics.c9
-rw-r--r--synaptics.h6
-rw-r--r--synclient.c2
-rw-r--r--syndaemon.c12
6 files changed, 31 insertions, 8 deletions
diff --git a/README b/README
index 0113a02..797c884 100644
--- a/README
+++ b/README
@@ -97,8 +97,10 @@ UpDownScrolling Bool If on, the up/down buttons generate button 4/5 events.
If off, the up button generates a double click and
the down button generates a button 2 event.
EmulateMidButtonTime Int max time (in milliseconds) for middle button emulation.
-TouchpadOff Bool If on, the Touchpad is switched off (useful
- if an external mouse is connected)
+TouchpadOff Int Switch off the touchpad. Valid values are:
+ 0 : Touchpad is enabled
+ 1 : Touchpad is switched off
+ 2 : Only tapping is switched off
GuestMouseOff Bool switch on/off guest mouse (often a stick)
LockedDrags Bool If off, a tap and drag gesture ends when you release
the finger. If on, the gesture is active until you
diff --git a/manpages/syndaemon.1 b/manpages/syndaemon.1
index f3890cb..283681c 100644
--- a/manpages/syndaemon.1
+++ b/manpages/syndaemon.1
@@ -17,6 +17,10 @@ How many seconds to wait after the last key press before enabling the touchpad.
.TP
\fB\-d\fP
Start as a daemon, ie in the background.
+.LP
+.TP
+\fB\-t\fP
+Only disable tapping, not mouse movements, in response to keyboard activity.
.SH "ENVIRONMENT VARIABLES"
.LP
.TP
diff --git a/synaptics.c b/synaptics.c
index d5a49ca..e86a924 100644
--- a/synaptics.c
+++ b/synaptics.c
@@ -324,7 +324,7 @@ SynapticsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
pars->edge_motion_use_always = xf86SetBoolOption(local->options, "EdgeMotionUseAlways", FALSE);
repeater = xf86SetStrOption(local->options, "Repeater", NULL);
pars->updown_button_scrolling = xf86SetBoolOption(local->options, "UpDownScrolling", TRUE);
- pars->touchpad_off = xf86SetBoolOption(local->options, "TouchpadOff", FALSE);
+ pars->touchpad_off = xf86SetIntOption(local->options, "TouchpadOff", 0);
pars->guestmouse_off = xf86SetBoolOption(local->options, "GuestMouseOff", FALSE);
pars->locked_drags = xf86SetBoolOption(local->options, "LockedDrags", FALSE);
pars->tap_action[RT_TAP] = xf86SetIntOption(local->options, "RTCornerButton", 2);
@@ -871,6 +871,11 @@ SelectTapButton(SynapticsPrivate *priv, edge_type edge)
{
TapEvent tap;
+ if (priv->synpara->touchpad_off == 2) {
+ priv->tap_button = 0;
+ return;
+ }
+
switch (priv->tap_max_fingers) {
case 1:
default:
@@ -1338,7 +1343,7 @@ HandleState(LocalDevicePtr local, struct SynapticsHwState *hw)
para->guest_dy = hw->guest_dy;
/* If touchpad is switched off, we skip the whole thing and return delay */
- if (para->touchpad_off == TRUE)
+ if (para->touchpad_off == 1)
return delay;
/* Treat the first two multi buttons as up/down for now. */
diff --git a/synaptics.h b/synaptics.h
index ca4406a..c66917f 100644
--- a/synaptics.h
+++ b/synaptics.h
@@ -66,7 +66,11 @@ typedef struct _SynapticsSHM
Bool edge_motion_use_always; /* If false, egde motion is used only when dragging */
Bool updown_button_scrolling; /* Up/Down-Button scrolling or middle/double-click */
- Bool touchpad_off; /* Switches the touchpad off */
+ int touchpad_off; /* Switches the touchpad off
+ * 0 : Not off
+ * 1 : Off
+ * 2 : Only tapping off
+ */
Bool guestmouse_off; /* Switches the guest mouse off */
Bool locked_drags; /* Enable locked drags */
int tap_action[MAX_TAP]; /* Button to report on tap events */
diff --git a/synclient.c b/synclient.c
index 7898e1b..64776b4 100644
--- a/synclient.c
+++ b/synclient.c
@@ -88,7 +88,7 @@ static struct Parameter params[] = {
DEFINE_PAR("EdgeMotionMaxSpeed", edge_motion_max_speed, PT_INT, 0, 500),
DEFINE_PAR("EdgeMotionUseAlways", edge_motion_use_always, PT_BOOL, 0, 1),
DEFINE_PAR("UpDownScrolling", updown_button_scrolling, PT_BOOL, 0, 1),
- DEFINE_PAR("TouchpadOff", touchpad_off, PT_BOOL, 0, 1),
+ DEFINE_PAR("TouchpadOff", touchpad_off, PT_INT, 0, 2),
DEFINE_PAR("GuestMouseOff", guestmouse_off, PT_BOOL, 0, 1),
DEFINE_PAR("LockedDrags", locked_drags, PT_BOOL, 0, 1),
DEFINE_PAR("RTCornerButton", tap_action[RT_TAP], PT_INT, 0, SYN_MAX_BUTTONS),
diff --git a/syndaemon.c b/syndaemon.c
index 70d1e14..3a498bf 100644
--- a/syndaemon.c
+++ b/syndaemon.c
@@ -32,6 +32,7 @@
static SynapticsSHM *synshm;
static int pad_disabled;
+static int disable_taps_only;
static int background = 0;
@@ -41,6 +42,7 @@ static void usage()
fprintf(stderr, " -i How many seconds to wait after the last key press before\n");
fprintf(stderr, " enabling the touchpad. (default is 2s)\n");
fprintf(stderr, " -d Start as a daemon, ie in the background.\n");
+ fprintf(stderr, " -t Only disable tapping, not mouse movements.\n");
exit(1);
}
@@ -151,7 +153,10 @@ static void main_loop(Display *display, double idle_time)
if (!background)
printf("Disable\n");
pad_disabled = 1;
- synshm->touchpad_off = 1;
+ if (disable_taps_only)
+ synshm->touchpad_off = 2;
+ else
+ synshm->touchpad_off = 1;
}
}
@@ -167,7 +172,7 @@ int main(int argc, char *argv[])
int shmid;
/* Parse command line parameters */
- while ((c = getopt(argc, argv, "i:d?")) != EOF) {
+ while ((c = getopt(argc, argv, "i:dt?")) != EOF) {
switch(c) {
case 'i':
idle_time = atof(optarg);
@@ -175,6 +180,9 @@ int main(int argc, char *argv[])
case 'd':
background = 1;
break;
+ case 't':
+ disable_taps_only = 1;
+ break;
default:
usage();
break;