|
GF4J 0.9.4 Beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface is meant for input devices that are keyboard-like in their operation. This means that the device has several (more than 10) buttons that are on/off type. The keycodes used in this interface are those defined in java.awt.event.KeyEvent class. If the devices buttons can't be directly mapped to those keycodes the mapping should be made in a such way that order of the keys are preserved, when counting the keys from topleft to the right, row by row. Also if the input device has directional control buttons, those must be mapped to cursor keycodes (VK_UP, VK_DOWN, VK_LEFT, VK_RIGHT).
Method Summary | |
void |
finalize()
Releases all resources held by the keyboard device implementation. |
int |
getKeyDownCount(int keyCode)
Returns the number of times the key has been stroken since last reading (after last call made to isKeyDown or getKeyDownCount methods with the same key code). |
int |
getTypedAlphanumericKey()
Returns any typed alphanumeric keys (including space and dot) as int values that correspond to that keys char value or -1 if no such keys were pressed after last invokation of this method. |
boolean |
isKeyDown(int keyCode)
Returns true if the key is down or if the key was briefly kept down after last reading of the keys state (after last call made to isKeyDown or getKeyDownCount methods with the same key code). |
boolean |
wasKeyDown(int keyCode)
Returns true if the key was briefly kept down after last reading of the keys state (after last call made to isKeyDown or getKeyDownCount methods with the same key code). |
Method Detail |
public boolean isKeyDown(int keyCode)
keyCode
- The keycode of the key we want to query.public boolean wasKeyDown(int keyCode)
keyCode
- The keycode of the key we want to query.public int getKeyDownCount(int keyCode)
keyCode
- The keycode of the key we want to query.public int getTypedAlphanumericKey()
public void finalize()
finalize
in class java.lang.Object
|
GF4J 0.9.4 Beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |