Package net.minecraftforge.client.event
Class InputEvent.KeyInputEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.client.event.InputEvent
net.minecraftforge.client.event.InputEvent.KeyInputEvent
- Enclosing class:
- InputEvent
This event fires when a keyboard input is detected.
- 
Nested Class SummaryNested classes/interfaces inherited from class net.minecraftforge.client.event.InputEventInputEvent.ClickInputEvent, InputEvent.KeyInputEvent, InputEvent.MouseInputEvent, InputEvent.MouseScrollEvent, InputEvent.RawMouseEventNested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Eventnet.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionintInteger representing the key's action.intgetKey()The keyboard key that triggered this event.intBit field representing the modifier keys pressed.intPlatform-specific scan code.Methods inherited from class net.minecraftforge.eventbus.api.EventgetListenerList, getParentListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult, setup
- 
Field Details- 
keyprivate final int key
- 
scanCodeprivate final int scanCode
- 
actionprivate final int action
- 
modifiersprivate final int modifiers
 
- 
- 
Constructor Details- 
KeyInputEventpublic KeyInputEvent(int key, int scanCode, int action, int modifiers) 
 
- 
- 
Method Details- 
getKeypublic int getKey()The keyboard key that triggered this event. https://www.glfw.org/docs/latest/group__keys.html- See Also:
- 
- key constants starting with "GLFW_KEY_"
 
 
- 
getScanCodepublic int getScanCode()Platform-specific scan code. Used forInputMappings#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.
- 
getActionpublic int getAction()Integer representing the key's action.- See Also:
- 
- GLFW.GLFW_PRESS
- GLFW.GLFW_RELEASE
- GLFW.GLFW_REPEAT
 
 
- 
getModifierspublic int getModifiers()Bit field representing the modifier keys pressed. https://www.glfw.org/docs/latest/group__mods.html- See Also:
- 
- GLFW.GLFW_MOD_SHIFT
- GLFW.GLFW_MOD_CONTROL
- GLFW.GLFW_MOD_ALT
- GLFW.GLFW_MOD_SUPER
 
 
 
-