simvx.graphics.input_adapter¶
Adapter to bridge GLFW input events to simvx.core.Input singleton.
Module Contents¶
Functions¶
Process GLFW key event and update Input state. |
|
Process GLFW mouse button event. |
|
Install UI routing callbacks (called by App._run_with_tree). |
|
Reset all UI routing callbacks to None. |
|
Process GLFW cursor position event and update Input state. |
|
Process GLFW scroll event and update Input state. |
|
Process GLFW character input event (typed characters). |
|
Key callback that also routes key events to UI. |
|
Mouse callback that also routes clicks to UI. |
|
Process SDL3 touch event and update Input state. |
|
Poll gamepads via GLFW and update Input state. |
Data¶
API¶
- simvx.graphics.input_adapter.key_callback(key: int, action: int, mods: int) None¶
Process GLFW key event and update Input state.
Args: key: GLFW key code action: GLFW_PRESS, GLFW_RELEASE, or GLFW_REPEAT mods: Modifier bits (shift, ctrl, alt, etc.)
- simvx.graphics.input_adapter.mouse_button_callback(button: int, action: int, mods: int) None¶
Process GLFW mouse button event.
Args: button: GLFW mouse button (0=left, 1=right, 2=middle, etc.) action: GLFW_PRESS or GLFW_RELEASE mods: Modifier bits
- simvx.graphics.input_adapter.set_ui_callbacks(*, char=None, key=None, mouse=None, motion=None, scroll=None)¶
Install UI routing callbacks (called by App._run_with_tree).
- simvx.graphics.input_adapter.clear_ui_callbacks()¶
Reset all UI routing callbacks to None.
- simvx.graphics.input_adapter.cursor_pos_callback(x: float, y: float) None¶
Process GLFW cursor position event and update Input state.
- simvx.graphics.input_adapter.scroll_callback(x_offset: float, y_offset: float) None¶
Process GLFW scroll event and update Input state.
- simvx.graphics.input_adapter.char_callback(codepoint: int) None¶
Process GLFW character input event (typed characters).
- simvx.graphics.input_adapter.key_callback_with_ui(key: int, action: int, mods: int) None¶
Key callback that also routes key events to UI.
- simvx.graphics.input_adapter.mouse_button_callback_with_ui(button: int, action: int, mods: int) None¶
Mouse callback that also routes clicks to UI.
- simvx.graphics.input_adapter.touch_callback(finger_id: int, action: int, x: float, y: float, pressure: float) None¶
Process SDL3 touch event and update Input state.
Args: finger_id: Unique finger identifier. action: 0=down, 1=up, 2=move. x, y: Position in window pixel coordinates. pressure: Touch pressure 0.0-1.0.
- simvx.graphics.input_adapter.poll_gamepads(window_backend: Any) None¶
Poll gamepads via GLFW and update Input state.
- simvx.graphics.input_adapter.__all__¶
[‘key_callback’, ‘mouse_button_callback’, ‘cursor_pos_callback’, ‘scroll_callback’, ‘char_callback’,…