Class InputEvent.Key
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.client.event.InputEvent
net.neoforged.neoforge.client.event.InputEvent.Key
- Enclosing class:
InputEvent
Fired when a keyboard key input occurs, such as pressing, releasing, or repeating a key.
This event is not cancellable.
This event is fired on the main Forge event bus, only on the logical client.
-
Nested Class Summary
Nested classes/interfaces inherited from class InputEvent
InputEvent.InteractionKeyMappingTriggered, InputEvent.Key, InputEvent.MouseButton, InputEvent.MouseScrollingEvent -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the keyboard button's action.intgetKey()Returns theSDLphysical key code.intReturns theSDLvirtual key code.intReturns a bit field representing the active modifier keys.
-
Field Details
-
keyEvent
-
action
private final int action
-
-
Constructor Details
-
Key
-
-
Method Details
-
getKeyEvent
-
getKey
public int getKey()Returns theSDLphysical key code.- Returns:
- the
SDLphysical key code - See Also:
-
getKeycode
public int getKeycode()Returns theSDLvirtual key code.- Returns:
- the
SDLvirtual key code - See Also:
-
getAction
public int getAction()Returns the keyboard button's action.- Returns:
- the keyboard button's action
- See Also:
-
getModifiers
public int getModifiers()Returns a bit field representing the active modifier keys.- Returns:
- a bit field representing the active modifier keys
- See Also:
-