Re: Input issues - key down with no key up

From: Jamie Lokier
Date: Wed Aug 20 2003 - 20:41:35 EST


Andries Brouwer wrote:
> There are many more problems with your synthesized events.
> Look at your "repeat delay + a bit more". Can you specify how much
> "a bit more" is?
>
> In times of heavy disk activity we lose interrupts.
> Indeed, if I copy a CD image or untar a kernel tree
> my keyboard and mouse are dead for several seconds.
>
> There is no guaranteed "a bit more" within which we will see a
> keyboard event.

I think we can safely arrange that if the timer expires, we can be
sure to check the 8042 for an event before synthesising one.

> If the only events that are seen are actual events, and on rare
> occasions we miss an event, that is not so bad. We just hit that
> key again. But if we synthesize events, then a missed key up
> causes autorepeat.

You've mixed the question synthetic UP with software autorepeat. They
are unrelated, and othogonal.

If you use software autorepeat, you have that problem of runaway
events _anyway_, nothing to do with UP. And if you don't use software
autorepeat, UP doesn't create a problem.

In fact, the synthetic UP is quite helpful if you miss real events.
For programs which, say, grab the keyboard focus until the user lets
go of a particular key, it is good that the program is eventually sent
an UP. Otherwise it won't give up the focus at all. Similarly, in a
game which does something as long as the player holds a key down,
missing the real event results in the game assuming the key is
perpetually held down.

> In fact I see unwanted autorepeat - maybe once a day
> suddenly a single keystroke causes three to five identical
characters to appear - but I am not sure what mechanism causes this.

Faulty laptop keyboards. I get it too, with 2.4 and 2.5 kernels.
It's not autorepeat, it's an instant burst of events.
Possibly bad debouncing.

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