Package limn.backend
Interface WindowInput
- All Known Implementing Classes:
Scene
public interface WindowInput
Receives a window's translated native input on the UI thread, in logical
points. The backend forwards events as they arrive during the native poll;
after each poll (and before draining
Ui.post tasks), it
calls inputBatchEnded(), which is where the scene dispatches its
(coalesced) queue. That yields the deterministic per-frame order: user
input → posted tasks → animation → layout → render.
Key codes and the modifier bitmask follow Keys
(GLFW-compatible values, but defined by the toolkit; no backend types leak).
-
Method Summary
Modifier and TypeMethodDescriptionvoidcharTyped(int codepoint) Committed text input, one code point (IME/layout-aware, after key events).default voidfilesDropped(List<Path> paths) Files dragged from the OS and dropped on the window.default voidEnd of one native poll: dispatch the accumulated batch now.voidkeyEvent(int key, boolean pressed, boolean repeat, int modifiers) voidmouseButton(int button, boolean pressed, int modifiers, float x, float y) Button press/release at the given cursor position.default voidmouseDelta(float dx, float dy) Relative pointer motion while the window is inPointerMode.RELATIVE: unbounded deltas in logical points (raw/unaccelerated where the platform supports it), replacingmouseMoved(float, float)for the duration of the capture.voidmouseMoved(float x, float y) voidpointerEntered(boolean entered) Cursor entered (true) or left the window's content area.default voidpreeditChanged(String text, int[] blockSizes, int focusedBlock, int caret) In-progress IME composition ("preedit") for the focused text input: the still-composing text plus its styled blocks and caret, shown inline but not yet committed (the commit arrives later viacharTyped(int)).voidscrolled(float deltaX, float deltaY, float x, float y) Wheel/trackpad scroll; deltas in native notches (positive = up/left).default voidThe bound window was destroyed.default voidwindowFocusChanged(boolean focused) The window gained or lost OS input focus.voidwindowResized(float logicalWidth, float logicalHeight) Window content resized (logical points).
-
Method Details
-
mouseMoved
void mouseMoved(float x, float y) -
mouseDelta
default void mouseDelta(float dx, float dy) Relative pointer motion while the window is inPointerMode.RELATIVE: unbounded deltas in logical points (raw/unaccelerated where the platform supports it), replacingmouseMoved(float, float)for the duration of the capture. The receiver may coalesce by summing. Default: ignored. -
mouseButton
void mouseButton(int button, boolean pressed, int modifiers, float x, float y) Button press/release at the given cursor position. -
scrolled
void scrolled(float deltaX, float deltaY, float x, float y) Wheel/trackpad scroll; deltas in native notches (positive = up/left). -
keyEvent
void keyEvent(int key, boolean pressed, boolean repeat, int modifiers) -
charTyped
void charTyped(int codepoint) Committed text input, one code point (IME/layout-aware, after key events). -
preeditChanged
In-progress IME composition ("preedit") for the focused text input: the still-composing text plus its styled blocks and caret, shown inline but not yet committed (the commit arrives later viacharTyped(int)). An emptytextclears the composition. Default: ignored.- Parameters:
text- the composing text (""clears it)blockSizes- code-point length of each styled block (tilestext)focusedBlock- index of the block being converted, or-1caret- caret position withintext, in code points
-
pointerEntered
void pointerEntered(boolean entered) Cursor entered (true) or left the window's content area. -
windowResized
void windowResized(float logicalWidth, float logicalHeight) Window content resized (logical points). May be coalesced by the receiver. -
filesDropped
Files dragged from the OS and dropped on the window. The drop lands at the current pointer position (the platform moves the cursor onto the window before dropping). Default: ignored. -
windowFocusChanged
default void windowFocusChanged(boolean focused) The window gained or lost OS input focus. On loss the scene cancels any in-flight press/drag/hover; the matching RELEASE will never arrive (it happens in another app), so it is synthesized. Default: ignored. -
inputBatchEnded
default void inputBatchEnded()End of one native poll: dispatch the accumulated batch now. -
windowClosed
default void windowClosed()The bound window was destroyed. Lets the receiver flush any work that was waiting on a future frame which will now never come, chiefly a window-fade arrival callback (e.g. a dialog completing its result after fading out), since a destroyed window never ticks again. UI thread.
-