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
| Event | Listener method |
|---|---|
MOUSE_SCROLLED | mouseScrolled(Minecraft, double amountX, double amountY) |
MOUSE_CLICKED_PRE | mouseClicked(Minecraft, MouseButtonInfo, int action) |
MOUSE_CLICKED_POST | mouseClicked(Minecraft, MouseButtonInfo, int action) |
KEY_PRESSED | keyPressed(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.