Re: Input issues - key down with no key up

From: Jamie Lokier
Date: Thu Aug 21 2003 - 09:01:56 EST


Andries Brouwer wrote:
> > > But for programs which want to monitor a key and know its state
> > > continuously (this presently includes the software autorepeater, but
> > > it also includes games), none of the behaviours is right.
> >
> > X11 is another example of software that wants to know the state of keys
> > continuously. And that's not a piece of software to ignore easily.
>
> You are both inventing the situation that games, or X11, ask the kernel
> for a bitmap of pressed keys. But they don't. The mechanism doesn't
> even exist.

I have no idea what X wants. What non-X "action" games want is simple
(I have written a few): to know when the user is pushing particular keys.

Those games achieve this by observing a DOWN event when a key is
pressed, an UP when it is released, to change their knowledge of a key
state, and ignoring events which don't change their knowledge of the
state: auto-repeat DOWN events or spurious UP events.

-- 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/