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

From: Måns Rullgård (mru@users.sourceforge.net)
Date: Thu May 01 2003 - 17:13:53 EST


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

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed May 07 2003 - 22:00:14 EST