| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | BUFFER_SIZE
Buffer size in events |
| public static final int | CHAR_NONE
The special character meaning that no character was translated for the event. |
| private static int | |
| private static boolean | created
Has the keyboard been created? |
| private static Keyboard. | current_event
current event |
| public static final int | EVENT_SIZE
Internal use - event size in bytes |
| private static InputImplementation | |
| private static boolean | initialized
One time initialization |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | KEY_LWIN
The left windows key, mapped to KEY_LMETA |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | KEY_NONE
The special keycode meaning that only the translated character is valid. |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | KEY_RWIN
The right windows key, mapped to KEY_RMETA |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| public static final int | |
| private static final int | keyCount
The number of keys supported |
| private static final ByteBuffer | keyDownBuffer
The keys status from the last poll |
| private static final Map | |
| private static final String[] | keyName
Key names |
| private static ByteBuffer | readBuffer
The key events from the last read: a sequence of pairs of key number, followed by state. |
| private static boolean | repeat_enabled
Are repeat events enabled? |
| private static Keyboard. | tmp_event
scratch event |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static boolean | Returns: true is repeat events are reported, false if not.Check whether repeat events are currently reported or not. |
| private static void | |
| public static void | |
| public static void | |
| public static void | |
| public static char | |
| public static int | Returns: The key from the current eventPlease note that the key code returned is NOT valid against the current keyboard layout. |
| public static boolean | Returns: True if key was down, or false if releasedGets the state of the key that generated the current event |
| public static long | Returns: The time in nanoseconds of the current eventGets the time in nanoseconds of the current event. |
| public static int | |
| public static synchronized int | |
| public static synchronized String | Returns: a String with the key's human readable name in it or null if the key is unnamedThe key key)Gets a key's name |
| public static int | Returns: the number of keyboard eventsGets the number of keyboard events waiting after doing a buffer enabled poll(). |
| private static void | |
| public static boolean | |
| public static boolean | Returns: true if the key is down according to the last poll()Keycode to check key)Checks to see if a key is down. |
| public static boolean | Returns: true if the current event is a repeat event, false if the current event is not a repeat even or if repeat events are disabled.
|
| public static boolean | |
| public static void | |
| private static void | |
| private static boolean | |
| private static void |
| BUFFER_SIZE | back to summary |
|---|---|
| private static final int BUFFER_SIZE Buffer size in events | |
| CHAR_NONE | back to summary |
|---|---|
| public static final int CHAR_NONE The special character meaning that no character was translated for the event. | |
| counter | back to summary |
|---|---|
| private static int counter | |
| created | back to summary |
|---|---|
| private static boolean created Has the keyboard been created? | |
| current_event | back to summary |
|---|---|
| private static Keyboard. current event | |
| EVENT_SIZE | back to summary |
|---|---|
| public static final int EVENT_SIZE Internal use - event size in bytes | |
| implementation | back to summary |
|---|---|
| private static InputImplementation implementation | |
| initialized | back to summary |
|---|---|
| private static boolean initialized One time initialization | |
| KEY_0 | back to summary |
|---|---|
| public static final int KEY_0 | |
| KEY_1 | back to summary |
|---|---|
| public static final int KEY_1 | |
| KEY_2 | back to summary |
|---|---|
| public static final int KEY_2 | |
| KEY_3 | back to summary |
|---|---|
| public static final int KEY_3 | |
| KEY_4 | back to summary |
|---|---|
| public static final int KEY_4 | |
| KEY_5 | back to summary |
|---|---|
| public static final int KEY_5 | |
| KEY_6 | back to summary |
|---|---|
| public static final int KEY_6 | |
| KEY_7 | back to summary |
|---|---|
| public static final int KEY_7 | |
| KEY_8 | back to summary |
|---|---|
| public static final int KEY_8 | |
| KEY_9 | back to summary |
|---|---|
| public static final int KEY_9 | |
| KEY_A | back to summary |
|---|---|
| public static final int KEY_A | |
| KEY_ADD | back to summary |
|---|---|
| public static final int KEY_ADD | |
| KEY_APOSTROPHE | back to summary |
|---|---|
| public static final int KEY_APOSTROPHE | |
| KEY_APPS | back to summary |
|---|---|
| public static final int KEY_APPS | |
| KEY_AT | back to summary |
|---|---|
| public static final int KEY_AT | |
| KEY_AX | back to summary |
|---|---|
| public static final int KEY_AX | |
| KEY_B | back to summary |
|---|---|
| public static final int KEY_B | |
| KEY_BACK | back to summary |
|---|---|
| public static final int KEY_BACK | |
| KEY_BACKSLASH | back to summary |
|---|---|
| public static final int KEY_BACKSLASH | |
| KEY_C | back to summary |
|---|---|
| public static final int KEY_C | |
| KEY_CAPITAL | back to summary |
|---|---|
| public static final int KEY_CAPITAL | |
| KEY_CIRCUMFLEX | back to summary |
|---|---|
| public static final int KEY_CIRCUMFLEX | |
| KEY_CLEAR | back to summary |
|---|---|
| public static final int KEY_CLEAR | |
| KEY_COLON | back to summary |
|---|---|
| public static final int KEY_COLON | |
| KEY_COMMA | back to summary |
|---|---|
| public static final int KEY_COMMA | |
| KEY_CONVERT | back to summary |
|---|---|
| public static final int KEY_CONVERT | |
| KEY_D | back to summary |
|---|---|
| public static final int KEY_D | |
| KEY_DECIMAL | back to summary |
|---|---|
| public static final int KEY_DECIMAL | |
| KEY_DELETE | back to summary |
|---|---|
| public static final int KEY_DELETE | |
| KEY_DIVIDE | back to summary |
|---|---|
| public static final int KEY_DIVIDE | |
| KEY_DOWN | back to summary |
|---|---|
| public static final int KEY_DOWN | |
| KEY_E | back to summary |
|---|---|
| public static final int KEY_E | |
| KEY_END | back to summary |
|---|---|
| public static final int KEY_END | |
| KEY_EQUALS | back to summary |
|---|---|
| public static final int KEY_EQUALS | |
| KEY_ESCAPE | back to summary |
|---|---|
| public static final int KEY_ESCAPE | |
| KEY_F | back to summary |
|---|---|
| public static final int KEY_F | |
| KEY_F1 | back to summary |
|---|---|
| public static final int KEY_F1 | |
| KEY_F10 | back to summary |
|---|---|
| public static final int KEY_F10 | |
| KEY_F11 | back to summary |
|---|---|
| public static final int KEY_F11 | |
| KEY_F12 | back to summary |
|---|---|
| public static final int KEY_F12 | |
| KEY_F13 | back to summary |
|---|---|
| public static final int KEY_F13 | |
| KEY_F14 | back to summary |
|---|---|
| public static final int KEY_F14 | |
| KEY_F15 | back to summary |
|---|---|
| public static final int KEY_F15 | |
| KEY_F16 | back to summary |
|---|---|
| public static final int KEY_F16 | |
| KEY_F17 | back to summary |
|---|---|
| public static final int KEY_F17 | |
| KEY_F18 | back to summary |
|---|---|
| public static final int KEY_F18 | |
| KEY_F19 | back to summary |
|---|---|
| public static final int KEY_F19 | |
| KEY_F2 | back to summary |
|---|---|
| public static final int KEY_F2 | |
| KEY_F3 | back to summary |
|---|---|
| public static final int KEY_F3 | |
| KEY_F4 | back to summary |
|---|---|
| public static final int KEY_F4 | |
| KEY_F5 | back to summary |
|---|---|
| public static final int KEY_F5 | |
| KEY_F6 | back to summary |
|---|---|
| public static final int KEY_F6 | |
| KEY_F7 | back to summary |
|---|---|
| public static final int KEY_F7 | |
| KEY_F8 | back to summary |
|---|---|
| public static final int KEY_F8 | |
| KEY_F9 | back to summary |
|---|---|
| public static final int KEY_F9 | |
| KEY_FUNCTION | back to summary |
|---|---|
| public static final int KEY_FUNCTION | |
| KEY_G | back to summary |
|---|---|
| public static final int KEY_G | |
| KEY_GRAVE | back to summary |
|---|---|
| public static final int KEY_GRAVE | |
| KEY_H | back to summary |
|---|---|
| public static final int KEY_H | |
| KEY_HOME | back to summary |
|---|---|
| public static final int KEY_HOME | |
| KEY_I | back to summary |
|---|---|
| public static final int KEY_I | |
| KEY_INSERT | back to summary |
|---|---|
| public static final int KEY_INSERT | |
| KEY_J | back to summary |
|---|---|
| public static final int KEY_J | |
| KEY_K | back to summary |
|---|---|
| public static final int KEY_K | |
| KEY_KANA | back to summary |
|---|---|
| public static final int KEY_KANA | |
| KEY_KANJI | back to summary |
|---|---|
| public static final int KEY_KANJI | |
| KEY_L | back to summary |
|---|---|
| public static final int KEY_L | |
| KEY_LBRACKET | back to summary |
|---|---|
| public static final int KEY_LBRACKET | |
| KEY_LCONTROL | back to summary |
|---|---|
| public static final int KEY_LCONTROL | |
| KEY_LEFT | back to summary |
|---|---|
| public static final int KEY_LEFT | |
| KEY_LMENU | back to summary |
|---|---|
| public static final int KEY_LMENU | |
| KEY_LMETA | back to summary |
|---|---|
| public static final int KEY_LMETA | |
| KEY_LSHIFT | back to summary |
|---|---|
| public static final int KEY_LSHIFT | |
| KEY_LWIN | back to summary |
|---|---|
| public static final int KEY_LWIN
Deprecated Use KEY_LMETA instead The left windows key, mapped to KEY_LMETA | |
| KEY_M | back to summary |
|---|---|
| public static final int KEY_M | |
| KEY_MINUS | back to summary |
|---|---|
| public static final int KEY_MINUS | |
| KEY_MULTIPLY | back to summary |
|---|---|
| public static final int KEY_MULTIPLY | |
| KEY_N | back to summary |
|---|---|
| public static final int KEY_N | |
| KEY_NEXT | back to summary |
|---|---|
| public static final int KEY_NEXT | |
| KEY_NOCONVERT | back to summary |
|---|---|
| public static final int KEY_NOCONVERT | |
| KEY_NONE | back to summary |
|---|---|
| public static final int KEY_NONE The special keycode meaning that only the translated character is valid. | |
| KEY_NUMLOCK | back to summary |
|---|---|
| public static final int KEY_NUMLOCK | |
| KEY_NUMPAD0 | back to summary |
|---|---|
| public static final int KEY_NUMPAD0 | |
| KEY_NUMPAD1 | back to summary |
|---|---|
| public static final int KEY_NUMPAD1 | |
| KEY_NUMPAD2 | back to summary |
|---|---|
| public static final int KEY_NUMPAD2 | |
| KEY_NUMPAD3 | back to summary |
|---|---|
| public static final int KEY_NUMPAD3 | |
| KEY_NUMPAD4 | back to summary |
|---|---|
| public static final int KEY_NUMPAD4 | |
| KEY_NUMPAD5 | back to summary |
|---|---|
| public static final int KEY_NUMPAD5 | |
| KEY_NUMPAD6 | back to summary |
|---|---|
| public static final int KEY_NUMPAD6 | |
| KEY_NUMPAD7 | back to summary |
|---|---|
| public static final int KEY_NUMPAD7 | |
| KEY_NUMPAD8 | back to summary |
|---|---|
| public static final int KEY_NUMPAD8 | |
| KEY_NUMPAD9 | back to summary |
|---|---|
| public static final int KEY_NUMPAD9 | |
| KEY_NUMPADCOMMA | back to summary |
|---|---|
| public static final int KEY_NUMPADCOMMA | |
| KEY_NUMPADENTER | back to summary |
|---|---|
| public static final int KEY_NUMPADENTER | |
| KEY_NUMPADEQUALS | back to summary |
|---|---|
| public static final int KEY_NUMPADEQUALS | |
| KEY_O | back to summary |
|---|---|
| public static final int KEY_O | |
| KEY_P | back to summary |
|---|---|
| public static final int KEY_P | |
| KEY_PAUSE | back to summary |
|---|---|
| public static final int KEY_PAUSE | |
| KEY_PERIOD | back to summary |
|---|---|
| public static final int KEY_PERIOD | |
| KEY_POWER | back to summary |
|---|---|
| public static final int KEY_POWER | |
| KEY_PRIOR | back to summary |
|---|---|
| public static final int KEY_PRIOR | |
| KEY_Q | back to summary |
|---|---|
| public static final int KEY_Q | |
| KEY_R | back to summary |
|---|---|
| public static final int KEY_R | |
| KEY_RBRACKET | back to summary |
|---|---|
| public static final int KEY_RBRACKET | |
| KEY_RCONTROL | back to summary |
|---|---|
| public static final int KEY_RCONTROL | |
| KEY_RETURN | back to summary |
|---|---|
| public static final int KEY_RETURN | |
| KEY_RIGHT | back to summary |
|---|---|
| public static final int KEY_RIGHT | |
| KEY_RMENU | back to summary |
|---|---|
| public static final int KEY_RMENU | |
| KEY_RMETA | back to summary |
|---|---|
| public static final int KEY_RMETA | |
| KEY_RSHIFT | back to summary |
|---|---|
| public static final int KEY_RSHIFT | |
| KEY_RWIN | back to summary |
|---|---|
| public static final int KEY_RWIN
Deprecated Use KEY_RMETA instead The right windows key, mapped to KEY_RMETA | |
| KEY_S | back to summary |
|---|---|
| public static final int KEY_S | |
| KEY_SCROLL | back to summary |
|---|---|
| public static final int KEY_SCROLL | |
| KEY_SECTION | back to summary |
|---|---|
| public static final int KEY_SECTION | |
| KEY_SEMICOLON | back to summary |
|---|---|
| public static final int KEY_SEMICOLON | |
| KEY_SLASH | back to summary |
|---|---|
| public static final int KEY_SLASH | |
| KEY_SLEEP | back to summary |
|---|---|
| public static final int KEY_SLEEP | |
| KEY_SPACE | back to summary |
|---|---|
| public static final int KEY_SPACE | |
| KEY_STOP | back to summary |
|---|---|
| public static final int KEY_STOP | |
| KEY_SUBTRACT | back to summary |
|---|---|
| public static final int KEY_SUBTRACT | |
| KEY_SYSRQ | back to summary |
|---|---|
| public static final int KEY_SYSRQ | |
| KEY_T | back to summary |
|---|---|
| public static final int KEY_T | |
| KEY_TAB | back to summary |
|---|---|
| public static final int KEY_TAB | |
| KEY_U | back to summary |
|---|---|
| public static final int KEY_U | |
| KEY_UNDERLINE | back to summary |
|---|---|
| public static final int KEY_UNDERLINE | |
| KEY_UNLABELED | back to summary |
|---|---|
| public static final int KEY_UNLABELED | |
| KEY_UP | back to summary |
|---|---|
| public static final int KEY_UP | |
| KEY_V | back to summary |
|---|---|
| public static final int KEY_V | |
| KEY_W | back to summary |
|---|---|
| public static final int KEY_W | |
| KEY_X | back to summary |
|---|---|
| public static final int KEY_X | |
| KEY_Y | back to summary |
|---|---|
| public static final int KEY_Y | |
| KEY_YEN | back to summary |
|---|---|
| public static final int KEY_YEN | |
| KEY_Z | back to summary |
|---|---|
| public static final int KEY_Z | |
| KEYBOARD_SIZE | back to summary |
|---|---|
| public static final int KEYBOARD_SIZE | |
| keyCount | back to summary |
|---|---|
| private static final int keyCount The number of keys supported | |
| keyDownBuffer | back to summary |
|---|---|
| private static final ByteBuffer keyDownBuffer The keys status from the last poll | |
| keyMap | back to summary |
|---|---|
| private static final Map<String, Integer> keyMap | |
| keyName | back to summary |
|---|---|
| private static final String[] keyName Key names | |
| readBuffer | back to summary |
|---|---|
| private static ByteBuffer readBuffer The key events from the last read: a sequence of pairs of key number, followed by state. The state is followed by a 4 byte code point representing the translated character. | |
| repeat_enabled | back to summary |
|---|---|
| private static boolean repeat_enabled Are repeat events enabled? | |
| tmp_event | back to summary |
|---|---|
| private static Keyboard. scratch event | |
| Keyboard | back to summary |
|---|---|
| private Keyboard() Keyboard cannot be constructed. | |
| areRepeatEventsEnabled | back to summary |
|---|---|
| public static boolean areRepeatEventsEnabled() Check whether repeat events are currently reported or not.
| |
| create | back to summary |
|---|---|
| private static void create(InputImplementation impl) throws LWJGLException "Create" the keyboard with the given implementation. This is used reflectively from AWTInputAdapter.
| |
| create | back to summary |
|---|---|
| public static void create() throws LWJGLException "Create" the keyboard. The display must first have been created. The reason for this is so the keyboard has a window to "focus" in.
| |
| destroy | back to summary |
|---|---|
| public static void destroy() "Destroy" the keyboard | |
| enableRepeatEvents | back to summary |
|---|---|
| public static void enableRepeatEvents(boolean enable) Controls whether repeat events are reported or not. If repeat events are enabled, key down events are reported when a key is pressed and held for a OS dependent amount of time. To distinguish a repeat event from a normal event, use isRepeatEvent(). | |
| getEventCharacter | back to summary |
|---|---|
public static char getEventCharacter()
| |
| getEventKey | back to summary |
|---|---|
| public static int getEventKey() Please note that the key code returned is NOT valid against the current keyboard layout. To get the actual character pressed call getEventCharacter
| |
| getEventKeyState | back to summary |
|---|---|
| public static boolean getEventKeyState() Gets the state of the key that generated the current event
| |
| getEventNanoseconds | back to summary |
|---|---|
| public static long getEventNanoseconds() Gets the time in nanoseconds of the current event. Only useful for relative comparisons with other Keyboard events, as the absolute time has no defined origin.
| |
| getKeyCount | back to summary |
|---|---|
public static int getKeyCount()
| |
| getKeyIndex | back to summary |
|---|---|
| public static synchronized int getKeyIndex(String keyName) Get's a key's index. If the key is unrecognised then KEY_NONE is returned.
| |
| getKeyName | back to summary |
|---|---|
| public static synchronized String getKeyName(int key) Gets a key's name
| |
| getNumKeyboardEvents | back to summary |
|---|---|
| public static int getNumKeyboardEvents() Gets the number of keyboard events waiting after doing a buffer enabled poll().
| |
| initialize | back to summary |
|---|---|
| private static void initialize() Static initialization | |
| isCreated | back to summary |
|---|---|
public static boolean isCreated()
| |
| isKeyDown | back to summary |
|---|---|
| public static boolean isKeyDown(int key) Checks to see if a key is down.
| |
| isRepeatEvent | back to summary |
|---|---|
public static boolean isRepeatEvent()
| |
| next | back to summary |
|---|---|
| public static boolean next() Gets the next keyboard event. You can query which key caused the event by using
| |
| poll | back to summary |
|---|---|
| public static void poll() Polls the keyboard for its current state. Access the polled values using the
Note This method does not query the operating system for new events. To do that, Display.processMessages() (or Display.update()) must be called first. | |
| read | back to summary |
|---|---|
| private static void read() | |
| readNext | back to summary |
|---|---|
| private static boolean readNext(Keyboard. | |
| reset | back to summary |
|---|---|
| private static void reset() | |
| Modifier and Type | Field and Description |
|---|---|
| private int | character
The current keyboard character being examined |
| private int | key
The current keyboard event key being examined |
| private long | nanos
The current event time |
| private boolean | repeat
Is the current event a repeated event? |
| private boolean | state
The current state of the key being examined in the event queue |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private void |
| character | back to summary |
|---|---|
| private int character The current keyboard character being examined | |
| key | back to summary |
|---|---|
| private int key The current keyboard event key being examined | |
| nanos | back to summary |
|---|---|
| private long nanos The current event time | |
| repeat | back to summary |
|---|---|
| private boolean repeat Is the current event a repeated event? | |
| state | back to summary |
|---|---|
| private boolean state The current state of the key being examined in the event queue | |
| KeyEvent | back to summary |
|---|---|
| private KeyEvent() | |
| reset | back to summary |
|---|---|
| private void reset() | |