[patch] ignore trackpad/mouse while typing

Till Straumann Till.Straumann at TU-Berlin.de
Tue Dec 3 16:03:44 EST 2002

Michel Dänzer wrote:
> On Fre, 2002-11-29 at 02:34, Till Straumann wrote:
>>+ 		if ( jiffies - mouse_holdoff_last_jiffie < mouse_holdoff_jiffies )
>>+ 			return;
>>+ 		/* Note: we could lose mouse events when the jiffie counter rolls over... */
> I think the difference is always correct.
No: if no key is pressed for (any integer multiple of) 2^32 jiffies then
mouse events are ignored during a short period of time following the
rollover ;-)
[ i.e. the rollover of the difference, not the jiffies; the true
   relation being
    (jiffies - mouse_holdoff_last_jiffie) % 2^32 < mouse_holdoff_jiffies

Anyways: the patch has another problem: the trivial version cannot deal

  - emulated mouse buttons (ignored because input_event() first receives
    a key event which is sent to the keyboard handler who remaps it to a
    mouse/button event to be ignored since it happens shortly after the
    key event triggering it)
  - 'modifiers' (Shift, Ctrl & friends). All keys seem to be
    'auto-repeated' by the input driver resulting in repeated
    key events while a modifier is pressed, hence causing the trivial
    patch to ignore mouse events while a modifier key is held down.

I'm working on an improved version supporting a (configurable but
reasonably defaulted) list of keys who are to be considered 'modifiers'.

-- Till

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

More information about the Linuxppc-dev mailing list