David Balazic writes:
> Rik Faith wrote:
> > It's been a number of years, but my understanding was that the keyboard
> > controller chip detected a lengthy key-down state and then started to send
> > fake key-up and key-down messages until the key was actually raised. This
> > is why the delay and rate depend on the keyboard controller chip.
I'm sorry, I don't have Rik's email to reply to.
The PC keyboard sends a key-down code when the key is initially pressed.
After the repeat delay, it sends another key-down code, which repeats at
the repeat rate until the key is released. At this point, it sends a
key-up code. Really, it makes more sense to call these codes "events".
When you have a tty open, the characters that you read from the device depend
on the mode that the VC is in. Eg, in RAW mode, you see the raw codes from
the keyboard. These (should be) untranslated, and may be architecture
specific (the "scancodes"). However, if the VC is in MEDIUM mode, you get
the ASCII characters.
There is a third mode, MEDIUM RAW which returns "key codes". Key code may
be translated scan codes, or may just be the raw scan codes themselves.
They may have other processing performed on them as well.
> But then how do games work ?
Games just look for the first key-down and corresponding key-up events. They
ignore the repeated key-down events. They would do their own processing
depending on their own ideas.
Hope this clears stuff up. If someone notices I've made a big mistake
somewhere, please let me know! ;)
_____
|_____| ------------------------------------------------- ---+---+-
| | Russell King rmk@arm.linux.org.uk --- ---
| | | | http://www.arm.linux.org.uk/~rmk/aboutme.html / / |
| +-+-+ --- -+-
/ | THE developer of ARM Linux |+| /|\
/ | | | --- |
+-+-+ ------------------------------------------------- /\\\ |
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/
This archive was generated by hypermail 2b29 : Fri Apr 07 2000 - 21:00:12 EST