Re: Input issues - key down with no key up

From: Vojtech Pavlik
Date: Mon Aug 25 2003 - 03:24:04 EST


On Mon, Aug 25, 2003 at 05:22:35AM +0100, Jamie Lokier wrote:

> > > Serge van den Boom reports that his LiteOn MediaTouch Keyboard
> > > has 18 additional keys: Suspend, Coffee, WWW, Calculator, Xfer,
> > > Switch window, Close, |<<, >|, [], >>|, Record, Rewind, Menu,
> > > Eject, Mute, Volume +, and Volume -. Of these, the keys |<<,
> > > >>|, Volume +, Volume - repeat. The others do not, except for
> > > the rather special Switch window key. Upon press it produces
> > > the LAlt-down, LShift-down, Tab-down, Tab-up sequence; it
> > > repeats Tab-down; and upon release it produces the sequence
> > > Tab-up, LAlt-up, LShift-up.
> > > (Up events are as usual for the other 17 keys.)
>
> Vojtech Pavlik wrote:
> > The code as is now (with the autorepeat and the forced up if the
> > keyboard itself doesn't start repeating) won't have any problems with
> > this keyboard.
>
> That works well for typing, but if someone tries to use these keys in
> an action game, they will disappointed with the forced-up code - the
> game will see the key pressed and released, even when the user holds
> the key down for a long time.

Indeed. Are you expecting a game to be able to use the WWW or Calculator
keys for anything useful?

> Unfortunately, not doing the forced-up thing causes much worse
> problems, with the keys which started this thread.
>
> There is only one solution which works well that I can see: do the
> forced-up thing by default, but as soon as you see a real UP event
> from a key, disabled forced-up _for that key_ in future.

Won't work. There are keyboards that forget to send a key up event
sometimes. They usually send it, but from time to time they don't.
We need to cover these keyboards, too. It's actually the main reason for
the whole forced up thingy.

> That gives perfect results for typing, and after the first press of a
> key it is perfect for games too.

I'll give you a kernel/module option to disable the forced up effect if
you have a perfect keyboard. You can then also enable the untranslated
mode and set 3. But the default will be translated set 2 with forced
keyups if a key is not repeating.

--
Vojtech Pavlik
SuSE Labs, SuSE CR
-
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/