Re: [RFC][PATCH] "Disable Trackpad while typing" on Notebooks withh a PS/2 Trackpad

Måns Rullgård
2003-05-01T22:10:28Z

Hans-Georg Thien <1682-600@onlinehome.de> writes:

> static inline void handle_keyboard_event(unsigned char scancode)
> {
> +
> +#ifdef CONFIG_DISABLE_TRACKPAD_WHILE_TYPING
> +
> + /* setup a timer to re-enable the trackpad */
> + static struct timer_list enable_trackpad_timer;
> + static int enable_trackpad_timer_initialized=0;
> +
> + disable_trackpad_while_typing=1; /* disable trackpad */
> +
> + if(enable_trackpad_timer_initialized)
> + {
> + /* trackpad timer already exists, - just restart it */
> + mod_timer(&enable_trackpad_timer, jiffies+trackpad_delay);
> + }
> + else
> + {
> + /* no trackpad timer yet. Initialize and start it */
> + init_timer(&enable_trackpad_timer);
> + enable_trackpad_timer.expires=jiffies+trackpad_delay;
> + enable_trackpad_timer.function=enable_trackpad;
> + add_timer(&enable_trackpad_timer);
> + enable_trackpad_timer_initialized=1;

The else block would probably be better off in some initialization
function. Maybe the same place that sets up the interrupt handler is
appropriate.

--
Måns Rullgård
mru@users.sf.net