Skip to main content
Version: 26.2

Client Raw Input Events

dev.architectury.event.events.client.ClientRawInputEvent

Low-level mouse and keyboard input, before it's routed to a screen. Every event returns an EventResult; interrupt it to swallow the input and stop vanilla from handling it.

Events

EventListener method
MOUSE_SCROLLEDmouseScrolled(Minecraft, double amountX, double amountY)
MOUSE_CLICKED_PREmouseClicked(Minecraft, MouseButtonInfo, int action)
MOUSE_CLICKED_POSTmouseClicked(Minecraft, MouseButtonInfo, int action)
KEY_PRESSEDkeyPressed(Minecraft, int action, KeyEvent)

Example

ClientRawInputEvent.KEY_PRESSED.register((client, action, keyEvent) -> {
// inspect keyEvent; return interrupt to consume the key
return EventResult.pass();
});
note

For input directed at an open screen (with the screen and cursor position), use Client Screen Input Events instead. To bind a named, configurable hotkey, register a key mapping - see the Client Registries section.