Re: [Q] Keyboard repeats stop when I hit another key. How do I get them back?
Re: [Q] Keyboard repeats stop when I hit another key. How do I get them back?
- Subject: Re: [Q] Keyboard repeats stop when I hit another key. How do I get them back?
- From: "John C. Randolph" <email@hidden>
- Date: Mon, 5 Nov 2001 14:23:18 -0800
On Monday, November 5, 2001, at 01:58 PM, Alexandre Aybes wrote:
my current problem is that when I get the key repeats (for example the
user holds the up arrow) I move correctly, but as soon as I hit another
key (let's say space to jump/fire/whatever) the arrow key repeats stop,
and therefore my character doesn't move anymore :-/
Well, the repeat will always be of the *last* key to go down. What
you'll probably need to do is sign up for keydown and keyup events, and
keep track yourself of what keys are down.
Some of Apple's keyboards have what's known as "2-key rollover", and to
do what you want, you may need a keyboard with "N-Key rollover."
To find out whether your keyboard has 2-key or N-key rollover, open the
"Key Caps" application, and see what it indicates when you hold down
three or more keys. When you hit the limit, additional keys pressed
won't show up. My NeXT keyboard apparently has five-key rollover.
Pity, because one thing I've had in mind to do for a *long* time, is
write an app that maps musical notes to the letter keys. (Sort of a
button-accordian style instrument.)
-jcr
"The Digital Millenium Copyright Act is the latest legislative proof of
the Peter Principle."