summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--COMPATIBILITY1
-rw-r--r--FEATURES1
-rw-r--r--FILES2
-rw-r--r--PARAMETER2
-rw-r--r--script/usbmouse19
-rw-r--r--synaptics.c9
-rw-r--r--synaptics.h1
-rw-r--r--synclient.c1
8 files changed, 36 insertions, 0 deletions
diff --git a/COMPATIBILITY b/COMPATIBILITY
index 63bf896..84e2e97 100644
--- a/COMPATIBILITY
+++ b/COMPATIBILITY
@@ -10,6 +10,7 @@ Aopen Openbook 1545/1545D
ASUS A1000
ASUS L2400D
ASUS L3500D
+ASUS L3500H
ASUS L3800C
ASUS L8400 series
ASUS M2400E
diff --git a/FEATURES b/FEATURES
index 9eb0e68..a30dd0e 100644
--- a/FEATURES
+++ b/FEATURES
@@ -21,3 +21,4 @@ taps for example):
- Multifinger taps: two finger for middle button and three finger for
right button events
- Online configuration through shared memory (Option: SHMConfig)
+- Touchpad can be switched off temporarily
diff --git a/FILES b/FILES
index b6c3e0a..9a1fd2f 100644
--- a/FILES
+++ b/FILES
@@ -5,3 +5,5 @@ synaptics.c Synaptics driver-module for xfree
synaptics.h see above
synclient.c Program for testing the shared-memory
shows the x, y-coordinates of the finger
+script/usbmouse script for shutting the touchpad down if
+ an external USB-mouse is attached
diff --git a/PARAMETER b/PARAMETER
index a975ada..b795f15 100644
--- a/PARAMETER
+++ b/PARAMETER
@@ -21,3 +21,5 @@ 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)
diff --git a/script/usbmouse b/script/usbmouse
new file mode 100644
index 0000000..c2f0dbe
--- /dev/null
+++ b/script/usbmouse
@@ -0,0 +1,19 @@
+#!/bin/bash
+while true
+do
+ if [ -e ~/.touchpad.on ]; then
+ synclient TouchpadOff=0
+ else
+ if [ -e ~/.touchpad.off ]; then
+ synclient TouchpadOff=1
+ else
+ if [ "`grep -e Mouse /proc/bus/usb/devices`" ]; then
+ synclient TouchpadOff=1
+ else
+ synclient TouchpadOff=0
+ fi
+ fi
+ fi
+ sleep 3
+done
+
diff --git a/synaptics.c b/synaptics.c
index fdaf105..9421b50 100644
--- a/synaptics.c
+++ b/synaptics.c
@@ -1,4 +1,8 @@
/*
+ * 2003 Jörg Bösner <ich@joerg-boesner.de>
+ * patch for switching the touchpad off (for example, when a
+ * USB mouse is connected)
+ *
* 2003 Hartwig Felger <hgfelger@hgfelger.de>
* patch to make the horizontal-wheel-replacement-buttons work.
*
@@ -389,6 +393,7 @@ SynapticsPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
priv->synpara->edge_motion_speed = xf86SetIntOption(local->options, "EdgeMotionSpeed", 40);
priv->synpara->repeater = xf86SetStrOption(local->options, "Repeater", NULL);
priv->synpara->updown_button_scrolling = xf86SetBoolOption(local->options, "UpDownScrolling", TRUE);
+ priv->synpara->touchpad_off = xf86SetBoolOption(local->options, "TouchpadOff", FALSE);
str_par = xf86FindOptionValue(local->options, "MinSpeed");
if((!str_par) || (xf86sscanf(str_par, "%lf", &priv->synpara->min_speed) != 1))
@@ -844,6 +849,10 @@ HandleState(LocalDevicePtr local, struct SynapticsHwState* hw)
long delay = 1000000000;
long timeleft;
+ /* If touchpad is switched off, we skip the whole thing and return delay */
+ if (para->touchpad_off == TRUE)
+ return delay;
+
edge = edge_detection(priv, hw->x, hw->y);
dx = dy = 0;
diff --git a/synaptics.h b/synaptics.h
index 72c215b..468f22b 100644
--- a/synaptics.h
+++ b/synaptics.h
@@ -36,6 +36,7 @@ typedef struct _SynapticsSHM
int edge_motion_speed; /* Edge motion speed when dragging */
char* repeater; /* Repeater on or off */
Bool updown_button_scrolling; /* Up/Down-Button scrolling or middle/double-click */
+ Bool touchpad_off; /* Switches the Touchpad off*/
} SynapticsSHM, *SynapticsSHMPtr;
#ifdef SYNAPTICS_PRIVATE
diff --git a/synclient.c b/synclient.c
index a50d5a0..e9f40fe 100644
--- a/synclient.c
+++ b/synclient.c
@@ -61,6 +61,7 @@ static struct Parameter params[] = {
DEFINE_PAR("AccelFactor", accl, PT_DOUBLE, 0, 0.2),
DEFINE_PAR("EdgeMotionSpeed", edge_motion_speed, PT_INT, 0, 400),
DEFINE_PAR("UpDownScrolling", updown_button_scrolling, PT_BOOL, 0, 1),
+ DEFINE_PAR("TouchpadOff", touchpad_off, PT_BOOL, 0, 1),
{ 0, 0, 0, 0, 0 }
};