public abstract static class GuiScreenEvent.KeyboardKeyEvent extends GuiScreenEvent
GuiScreenEvent.ActionPerformedEvent, GuiScreenEvent.BackgroundDrawnEvent, GuiScreenEvent.DrawScreenEvent, GuiScreenEvent.InitGuiEvent, GuiScreenEvent.KeyboardCharTypedEvent, GuiScreenEvent.KeyboardKeyEvent, GuiScreenEvent.KeyboardKeyPressedEvent, GuiScreenEvent.KeyboardKeyReleasedEvent, GuiScreenEvent.MouseClickedEvent, GuiScreenEvent.MouseDragEvent, GuiScreenEvent.MouseInputEvent, GuiScreenEvent.MouseReleasedEvent, GuiScreenEvent.MouseScrollEvent, GuiScreenEvent.PotionShiftEvent
Modifier and Type | Field and Description |
---|---|
private int |
keyCode |
private int |
modifiers |
private int |
scanCode |
Constructor and Description |
---|
KeyboardKeyEvent(Screen gui,
int keyCode,
int scanCode,
int modifiers) |
Modifier and Type | Method and Description |
---|---|
int |
getKeyCode()
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.
|
getGui
private final int keyCode
private final int scanCode
private final int modifiers
public KeyboardKeyEvent(Screen gui, int keyCode, int scanCode, int modifiers)
public int getKeyCode()
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 getModifiers()
GLFW.GLFW_MOD_SHIFT
,
GLFW.GLFW_MOD_CONTROL
,
GLFW.GLFW_MOD_ALT
,
GLFW.GLFW_MOD_SUPER