public static class InputEvent.KeyInputEvent extends InputEvent
InputEvent.KeyInputEvent, InputEvent.MouseInputEvent
Constructor and Description |
---|
KeyInputEvent(int key,
int scanCode,
int action,
int modifiers) |
Modifier and Type | Method and Description |
---|---|
int |
getAction() |
int |
getKey()
The keyboard key that was pressed or released
https://www.glfw.org/docs/latest/group__keys.html
|
int |
getModifiers()
Bit field representing the modifier keys pressed.
|
int |
getScanCode()
Platform-specific scan code.
|
public KeyInputEvent(int key, int scanCode, int action, int modifiers)
public int getKey()
key constants starting with "GLFW_KEY_"
public int getScanCode()
InputMappings.getInputByCode(int, int)
The scan code is unique for every key, regardless of whether it has a key code.
Scan codes are platform-specific but consistent over time, so keys will have different scan codes depending
on the platform but they are safe to save to disk as custom key bindings.public int getAction()
public int getModifiers()
GLFW.GLFW_MOD_SHIFT
,
GLFW.GLFW_MOD_CONTROL
,
GLFW.GLFW_MOD_ALT
,
GLFW.GLFW_MOD_SUPER