class KeyInput
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private boolean |
capsLock |
private static KeyInput |
instance |
private IntSet |
keys |
private char[] |
NO_CHAR |
private boolean |
numLock |
private KeyState |
state |
Constructor and Description |
---|
KeyInput() |
Modifier and Type | Method and Description |
---|---|
private void |
dispatchKeyEvent(KeyState ks,
int type,
int key) |
(package private) static KeyInput |
getInstance() |
private char[] |
getKeyChars(KeyState state,
int key) |
(package private) int |
getKeyCodeForChar(char c) |
(package private) void |
getState(KeyState result)
Copies the current state into the KeyState provided.
|
(package private) void |
setState(KeyState newState)
Called from the input processor to update the key state and send
key events.
|
private static KeyInput instance
private KeyState state
private IntSet keys
private boolean numLock
private boolean capsLock
private char[] NO_CHAR
static KeyInput getInstance()
void getState(KeyState result)
result
- target into which to copy the key statevoid setState(KeyState newState)
newState
- The updated key stateprivate void dispatchKeyEvent(KeyState ks, int type, int key)
private char[] getKeyChars(KeyState state, int key)
int getKeyCodeForChar(char c)