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 Type
    Method
    Description
    void
    charTyped(int codepoint)
    Committed text input, one code point (IME/layout-aware, after key events).
    default void
    Files dragged from the OS and dropped on the window.
    default void
    End of one native poll: dispatch the accumulated batch now.
    void
    keyEvent(int key, boolean pressed, boolean repeat, int modifiers)
     
    void
    mouseButton(int button, boolean pressed, int modifiers, float x, float y)
    Button press/release at the given cursor position.
    default void
    mouseDelta(float dx, float dy)
    Relative pointer motion while the window is in PointerMode.RELATIVE: unbounded deltas in logical points (raw/unaccelerated where the platform supports it), replacing mouseMoved(float, float) for the duration of the capture.
    void
    mouseMoved(float x, float y)
     
    void
    pointerEntered(boolean entered)
    Cursor entered (true) or left the window's content area.
    default void
    preeditChanged(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 via charTyped(int)).
    void
    scrolled(float deltaX, float deltaY, float x, float y)
    Wheel/trackpad scroll; deltas in native notches (positive = up/left).
    default void
    The bound window was destroyed.
    default void
    windowFocusChanged(boolean focused)
    The window gained or lost OS input focus.
    void
    windowResized(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 in PointerMode.RELATIVE: unbounded deltas in logical points (raw/unaccelerated where the platform supports it), replacing mouseMoved(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

      default void preeditChanged(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 via charTyped(int)). An empty text clears the composition. Default: ignored.
      Parameters:
      text - the composing text ("" clears it)
      blockSizes - code-point length of each styled block (tiles text)
      focusedBlock - index of the block being converted, or -1
      caret - caret position within text, 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

      default void filesDropped(List<Path> paths)
      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.