Keyboard repeating
Is it possible to directly read the status of pressed keys without KeyEvents? Holding a button causes KeyEvents to be repeated according to the typematic rate.I'd like to read the keyboard status within a thread 100 times per second or so.Thanks.
[275 byte] By [
foexxchen] at [2007-9-27 15:00:48]

Timer changeTimer = new Timer(delay);
public void keyPressed()
{
if (!changeTimer.isRunning()
{
//do the task you wish to do when
a key is first pressed...
timer.start()
}
}
public void changeTimer_actionPerformed(ActionEvent ae)
{
//do the task you wish to be performed
//when a key is being held down
}
> The answer is no although that is being> pushed from the javagaming.org site, everyone wants> it.and i can see why - causing an Event dispatch just to set a flag, when the flag is already available from the OS is soooo inefficient!
Abuse at 2007-7-5 23:01:07 >
