com.jpemartin.jgt
Class KeyboardStatus
java.lang.Object
com.jpemartin.jgt.KeyboardStatus
- All Implemented Interfaces:
- java.awt.event.KeyListener, java.util.EventListener
public class KeyboardStatus
- extends java.lang.Object
- implements java.awt.event.KeyListener
Maintains a boolean array: for each key, true if the key is pressed.
The idea is that you register a KeyboardStatus as KeyListener in your application
and then you can look up the array to see which keys are down.
- Author:
- jpmartin
|
Field Summary |
boolean[] |
key
|
|
Method Summary |
void |
keyPressed(java.awt.event.KeyEvent arg0)
|
void |
keyReleased(java.awt.event.KeyEvent arg0)
|
void |
keyTyped(java.awt.event.KeyEvent arg0)
|
void |
reset()
consider all keys "up" regardless of their actual state |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
key
public boolean[] key
KeyboardStatus
public KeyboardStatus()
reset
public void reset()
- consider all keys "up" regardless of their actual state
keyTyped
public void keyTyped(java.awt.event.KeyEvent arg0)
- Specified by:
keyTyped in interface java.awt.event.KeyListener
keyPressed
public void keyPressed(java.awt.event.KeyEvent arg0)
- Specified by:
keyPressed in interface java.awt.event.KeyListener
keyReleased
public void keyReleased(java.awt.event.KeyEvent arg0)
- Specified by:
keyReleased in interface java.awt.event.KeyListener