public class Keyboard
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
CHAR_NONE
The special character meaning that no
character was translated for the event.
|
static int |
EVENT_SIZE
Internal use - event size in bytes
|
static int |
KEY_0 |
static int |
KEY_1 |
static int |
KEY_2 |
static int |
KEY_3 |
static int |
KEY_4 |
static int |
KEY_5 |
static int |
KEY_6 |
static int |
KEY_7 |
static int |
KEY_8 |
static int |
KEY_9 |
static int |
KEY_A |
static int |
KEY_ADD |
static int |
KEY_APOSTROPHE |
static int |
KEY_APPS |
static int |
KEY_AT |
static int |
KEY_AX |
static int |
KEY_B |
static int |
KEY_BACK |
static int |
KEY_BACKSLASH |
static int |
KEY_C |
static int |
KEY_CAPITAL |
static int |
KEY_CIRCUMFLEX |
static int |
KEY_CLEAR |
static int |
KEY_COLON |
static int |
KEY_COMMA |
static int |
KEY_CONVERT |
static int |
KEY_D |
static int |
KEY_DECIMAL |
static int |
KEY_DELETE |
static int |
KEY_DIVIDE |
static int |
KEY_DOWN |
static int |
KEY_E |
static int |
KEY_END |
static int |
KEY_EQUALS |
static int |
KEY_ESCAPE |
static int |
KEY_F |
static int |
KEY_F1 |
static int |
KEY_F10 |
static int |
KEY_F11 |
static int |
KEY_F12 |
static int |
KEY_F13 |
static int |
KEY_F14 |
static int |
KEY_F15 |
static int |
KEY_F16 |
static int |
KEY_F17 |
static int |
KEY_F18 |
static int |
KEY_F19 |
static int |
KEY_F2 |
static int |
KEY_F3 |
static int |
KEY_F4 |
static int |
KEY_F5 |
static int |
KEY_F6 |
static int |
KEY_F7 |
static int |
KEY_F8 |
static int |
KEY_F9 |
static int |
KEY_FUNCTION |
static int |
KEY_G |
static int |
KEY_GRAVE |
static int |
KEY_H |
static int |
KEY_HOME |
static int |
KEY_I |
static int |
KEY_INSERT |
static int |
KEY_J |
static int |
KEY_K |
static int |
KEY_KANA |
static int |
KEY_KANJI |
static int |
KEY_L |
static int |
KEY_LBRACKET |
static int |
KEY_LCONTROL |
static int |
KEY_LEFT |
static int |
KEY_LMENU |
static int |
KEY_LMETA |
static int |
KEY_LSHIFT |
static int |
KEY_LWIN
Deprecated.
Use KEY_LMETA instead
|
static int |
KEY_M |
static int |
KEY_MINUS |
static int |
KEY_MULTIPLY |
static int |
KEY_N |
static int |
KEY_NEXT |
static int |
KEY_NOCONVERT |
static int |
KEY_NONE
The special keycode meaning that only the
translated character is valid.
|
static int |
KEY_NUMLOCK |
static int |
KEY_NUMPAD0 |
static int |
KEY_NUMPAD1 |
static int |
KEY_NUMPAD2 |
static int |
KEY_NUMPAD3 |
static int |
KEY_NUMPAD4 |
static int |
KEY_NUMPAD5 |
static int |
KEY_NUMPAD6 |
static int |
KEY_NUMPAD7 |
static int |
KEY_NUMPAD8 |
static int |
KEY_NUMPAD9 |
static int |
KEY_NUMPADCOMMA |
static int |
KEY_NUMPADENTER |
static int |
KEY_NUMPADEQUALS |
static int |
KEY_O |
static int |
KEY_P |
static int |
KEY_PAUSE |
static int |
KEY_PERIOD |
static int |
KEY_POWER |
static int |
KEY_PRIOR |
static int |
KEY_Q |
static int |
KEY_R |
static int |
KEY_RBRACKET |
static int |
KEY_RCONTROL |
static int |
KEY_RETURN |
static int |
KEY_RIGHT |
static int |
KEY_RMENU |
static int |
KEY_RMETA |
static int |
KEY_RSHIFT |
static int |
KEY_RWIN
Deprecated.
Use KEY_RMETA instead
|
static int |
KEY_S |
static int |
KEY_SCROLL |
static int |
KEY_SECTION |
static int |
KEY_SEMICOLON |
static int |
KEY_SLASH |
static int |
KEY_SLEEP |
static int |
KEY_SPACE |
static int |
KEY_STOP |
static int |
KEY_SUBTRACT |
static int |
KEY_SYSRQ |
static int |
KEY_T |
static int |
KEY_TAB |
static int |
KEY_U |
static int |
KEY_UNDERLINE |
static int |
KEY_UNLABELED |
static int |
KEY_UP |
static int |
KEY_V |
static int |
KEY_W |
static int |
KEY_X |
static int |
KEY_Y |
static int |
KEY_YEN |
static int |
KEY_Z |
static int |
KEYBOARD_SIZE |
Modifier and Type | Method and Description |
---|---|
static boolean |
areRepeatEventsEnabled()
Check whether repeat events are currently reported or not.
|
static void |
create()
"Create" the keyboard.
|
static void |
destroy()
"Destroy" the keyboard
|
static void |
enableRepeatEvents(boolean enable)
Controls whether repeat events are reported or not.
|
static char |
getEventCharacter() |
static int |
getEventKey()
Please note that the key code returned is NOT valid against the
current keyboard layout.
|
static boolean |
getEventKeyState()
Gets the state of the key that generated the
current event
|
static long |
getEventNanoseconds()
Gets the time in nanoseconds of the current event.
|
static int |
getKeyCount() |
static int |
getKeyIndex(java.lang.String keyName)
Get's a key's index.
|
static java.lang.String |
getKeyName(int key)
Gets a key's name
|
static int |
getNumKeyboardEvents()
Gets the number of keyboard events waiting after doing a buffer enabled poll().
|
static boolean |
isCreated() |
static boolean |
isKeyDown(int key)
Checks to see if a key is down.
|
static boolean |
isRepeatEvent() |
static boolean |
next()
Gets the next keyboard event.
|
static void |
poll()
Polls the keyboard for its current state.
|
public static final int EVENT_SIZE
public static final int CHAR_NONE
public static final int KEY_NONE
public static final int KEY_ESCAPE
public static final int KEY_1
public static final int KEY_2
public static final int KEY_3
public static final int KEY_4
public static final int KEY_5
public static final int KEY_6
public static final int KEY_7
public static final int KEY_8
public static final int KEY_9
public static final int KEY_0
public static final int KEY_MINUS
public static final int KEY_EQUALS
public static final int KEY_BACK
public static final int KEY_TAB
public static final int KEY_Q
public static final int KEY_W
public static final int KEY_E
public static final int KEY_R
public static final int KEY_T
public static final int KEY_Y
public static final int KEY_U
public static final int KEY_I
public static final int KEY_O
public static final int KEY_P
public static final int KEY_LBRACKET
public static final int KEY_RBRACKET
public static final int KEY_RETURN
public static final int KEY_LCONTROL
public static final int KEY_A
public static final int KEY_S
public static final int KEY_D
public static final int KEY_F
public static final int KEY_G
public static final int KEY_H
public static final int KEY_J
public static final int KEY_K
public static final int KEY_L
public static final int KEY_SEMICOLON
public static final int KEY_APOSTROPHE
public static final int KEY_GRAVE
public static final int KEY_LSHIFT
public static final int KEY_BACKSLASH
public static final int KEY_Z
public static final int KEY_X
public static final int KEY_C
public static final int KEY_V
public static final int KEY_B
public static final int KEY_N
public static final int KEY_M
public static final int KEY_COMMA
public static final int KEY_PERIOD
public static final int KEY_SLASH
public static final int KEY_RSHIFT
public static final int KEY_MULTIPLY
public static final int KEY_LMENU
public static final int KEY_SPACE
public static final int KEY_CAPITAL
public static final int KEY_F1
public static final int KEY_F2
public static final int KEY_F3
public static final int KEY_F4
public static final int KEY_F5
public static final int KEY_F6
public static final int KEY_F7
public static final int KEY_F8
public static final int KEY_F9
public static final int KEY_F10
public static final int KEY_NUMLOCK
public static final int KEY_SCROLL
public static final int KEY_NUMPAD7
public static final int KEY_NUMPAD8
public static final int KEY_NUMPAD9
public static final int KEY_SUBTRACT
public static final int KEY_NUMPAD4
public static final int KEY_NUMPAD5
public static final int KEY_NUMPAD6
public static final int KEY_ADD
public static final int KEY_NUMPAD1
public static final int KEY_NUMPAD2
public static final int KEY_NUMPAD3
public static final int KEY_NUMPAD0
public static final int KEY_DECIMAL
public static final int KEY_F11
public static final int KEY_F12
public static final int KEY_F13
public static final int KEY_F14
public static final int KEY_F15
public static final int KEY_F16
public static final int KEY_F17
public static final int KEY_F18
public static final int KEY_KANA
public static final int KEY_F19
public static final int KEY_CONVERT
public static final int KEY_NOCONVERT
public static final int KEY_YEN
public static final int KEY_NUMPADEQUALS
public static final int KEY_CIRCUMFLEX
public static final int KEY_AT
public static final int KEY_COLON
public static final int KEY_UNDERLINE
public static final int KEY_KANJI
public static final int KEY_STOP
public static final int KEY_AX
public static final int KEY_UNLABELED
public static final int KEY_NUMPADENTER
public static final int KEY_RCONTROL
public static final int KEY_SECTION
public static final int KEY_NUMPADCOMMA
public static final int KEY_DIVIDE
public static final int KEY_SYSRQ
public static final int KEY_RMENU
public static final int KEY_FUNCTION
public static final int KEY_PAUSE
public static final int KEY_HOME
public static final int KEY_UP
public static final int KEY_PRIOR
public static final int KEY_LEFT
public static final int KEY_RIGHT
public static final int KEY_END
public static final int KEY_DOWN
public static final int KEY_NEXT
public static final int KEY_INSERT
public static final int KEY_DELETE
public static final int KEY_CLEAR
public static final int KEY_LMETA
public static final int KEY_LWIN
public static final int KEY_RMETA
public static final int KEY_RWIN
public static final int KEY_APPS
public static final int KEY_POWER
public static final int KEY_SLEEP
public static final int KEYBOARD_SIZE
public static void create() throws LWJGLException
LWJGLException
- if the keyboard could not be created for any reasonpublic static boolean isCreated()
public static void destroy()
public static void poll()
isKeyDown
method.
By using this method, it is possible to "miss" keyboard keys if you don't
poll fast enough.
To use buffered values, you have to call next
for each event you
want to read. You can query which key caused the event by using
getEventKey
. To get the state of that key, for that event, use
getEventKeyState
- finally use getEventCharacter
to get the
character for that event.
NOTE: This method does not query the operating system for new events. To do that,
Display.processMessages() (or Display.update()) must be called first.public static boolean isKeyDown(int key)
key
- Keycode to checkpublic static java.lang.String getKeyName(int key)
key
- The keypublic static int getKeyIndex(java.lang.String keyName)
keyName
- The key namepublic static int getNumKeyboardEvents()
public static boolean next()
getEventKey
. To get the state of that key, for that event, use
getEventKeyState
- finally use getEventCharacter
to get the
character for that event.getEventKey()
,
getEventKeyState()
,
getEventCharacter()
public static void enableRepeatEvents(boolean enable)
getEventKey()
public static boolean areRepeatEventsEnabled()
getEventKey()
public static int getKeyCount()
public static char getEventCharacter()
public static int getEventKey()
public static boolean getEventKeyState()
public static long getEventNanoseconds()
public static boolean isRepeatEvent()
enableRepeatEvents(boolean)
Copyright © 2002-2009 lwjgl.org. All Rights Reserved.