Disable the whole touchpad, not just tapping, during

keyboard activity.
This commit is contained in:
Peter Osterlund
2003-11-02 11:51:49 +01:00
parent 91c7a9f800
commit 91fdf85fba
2 changed files with 10 additions and 16 deletions

View File

@@ -779,10 +779,6 @@ HandleState(LocalDevicePtr local, struct SynapticsHwState* hw)
long timeleft;
int i;
/* 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;
@@ -807,6 +803,10 @@ HandleState(LocalDevicePtr local, struct SynapticsHwState* hw)
for (i = 0; i < 8; i++)
para->multi[i] = hw->multi[i];
/* If touchpad is switched off, we skip the whole thing and return delay */
if (para->touchpad_off == TRUE)
return delay;
/* Treat the first two multi buttons as up/down for now. */
hw->up |= hw->multi[0];
hw->down |= hw->multi[1];

View File

@@ -12,7 +12,7 @@
static SynapticsSHM *synshm;
static int pad_disabled;
static int saved_tap_time;
static Bool saved_touchpad_off;
static void usage()
@@ -26,7 +26,7 @@ static void usage()
static void signal_handler(int signum)
{
if (pad_disabled) {
synshm->tap_time = saved_tap_time;
synshm->touchpad_off = saved_touchpad_off;
pad_disabled = 0;
}
kill(getpid(), signum);
@@ -119,21 +119,15 @@ static void main_loop(Display *display, double idle_time)
if (current_time > last_activity + idle_time) { /* Enable touchpad */
if (pad_disabled) {
printf("Enable\n");
synshm->tap_time = saved_tap_time;
synshm->touchpad_off = saved_touchpad_off;
pad_disabled = 0;
}
} else { /* Disable touchpad */
if (!pad_disabled) {
printf("Disable\n");
saved_tap_time = synshm->tap_time;
synshm->tap_time = 0;
saved_touchpad_off = synshm->touchpad_off;
synshm->touchpad_off = 1;
pad_disabled = 1;
} else {
/* Already disabled. Update saved_tap_time if needed */
if (synshm->tap_time) {
printf("Updating tap_time\n");
saved_tap_time = synshm->tap_time;
}
}
}
@@ -143,7 +137,7 @@ static void main_loop(Display *display, double idle_time)
int main(int argc, char *argv[])
{
double idle_time = 3.0;
double idle_time = 2.0;
Display *display;
int c;
int shmid;