Lwjgl2InputForwarder
final class Lwjgl2InputForwarder
Package: dev.joid.base.lwjgl2.input · Module: base-lwjgl2 · Source: Lwjgl2InputForwarder.java
Backends: LWJGL 2
Reads the pending mouse and keyboard events of LWJGL 2 and forwards them to the UI bridges of JOID.
Learn more
Section titled “Learn more”Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
void | poll() static | Drains the event queues of Mouse and Keyboard and forwards every event with forwardMouseEvent() and forwardKeyboardEvent(). |
boolean | forwardMouseEvent() static | Forwards the current event of Mouse, after Mouse.next(), to BridgeHandler.UI: a move, a press or a release, and the wheel in notches of 120. |
boolean | forwardKeyboardEvent() static | Forwards the current event of Keyboard, after Keyboard.next(), to BridgeHandler.UI: a press with the character it types, a repeat as a question on its press with its character, a release, or a character alone. |
boolean | isForwardingMouseEvent() static | If true, forwardMouseEvent() is running, and Lwjgl2WindowBridge reads the position of the event of Mouse instead of its current position. |
Method details
Section titled “Method details”void poll() static
Drains the event queues of Mouse and Keyboard and forwards every event with forwardMouseEvent() and forwardKeyboardEvent().
Call it once per frame, before frame(); the rest of the application does not receive the events that it reads.
forwardMouseEvent
Section titled “forwardMouseEvent”boolean forwardMouseEvent() static
Forwards the current event of Mouse, after Mouse.next(), to BridgeHandler.UI: a move, a press or a release, and the wheel in notches of 120.
During the call, Lwjgl2WindowBridge reports the position of the event.
Returns true when JOID consumed the event, which the host then drops.
forwardKeyboardEvent
Section titled “forwardKeyboardEvent”boolean forwardKeyboardEvent() static
Forwards the current event of Keyboard, after Keyboard.next(), to BridgeHandler.UI: a press with the character it types, a repeat as a question on its press with its character, a release, or a character alone.
Returns true when JOID consumed the event, which the host then drops.
isForwardingMouseEvent
Section titled “isForwardingMouseEvent”boolean isForwardingMouseEvent() static
If true, forwardMouseEvent() is running, and Lwjgl2WindowBridge reads the position of the event of Mouse instead of its current position.
fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses
