simvx.core.ui.ui_input¶
UIInputManager: UI input routing, focus, modal stack, hit-testing.
All UI input flows through one contract: Control._on_gui_input(event).
When a modal Control is active (pushed via Control.show_modal()), routing
is gated to the modal’s subtree: outside clicks fall through to the
auto-injected ModalBackdrop, keyboard events go to the focused descendant
with router-level fallbacks for Tab cycling and Escape-dismiss.
Module Contents¶
Classes¶
Routes UI input events to controls: focus, hover, mouse grab, modal stack. |
Data¶
API¶
- simvx.core.ui.ui_input.log¶
‘getLogger(…)’
- class simvx.core.ui.ui_input.UIInputManager[source]¶
Routes UI input events to controls: focus, hover, mouse grab, modal stack.
Initialization
- push_modal(control)[source]¶
Register a control as an active modal (captures all UI input, drawn on top).
Clears any pre-existing mouse grab outside the new modal subtree, since modal capture invalidates grabs from the underlying scene.
- pop_modal(control)[source]¶
Unregister a modal control. Clears mouse grab and focus inside its subtree.
- ui_input(root: simvx.core.node.Node | None, mouse_pos=None, button: simvx.core.input.enums.MouseButton | None = None, pressed: bool = True, key: str = '', char: str = '')[source]¶
Route a UI input event.
buttonis aMouseButtonenum for mouse press/release events, orNonefor keyboard / char / pure mouse-move events.
- touch_input(root: simvx.core.node.Node | None, finger_id: int, action: int, x: float, y: float)[source]¶
Route a multi-touch event.
For controls with
touch_mode='multi', each finger is tracked independently. On down: hit-test for the control, store in_touch_grabs, deliver press. On move: deliver to grabbed control. On up: deliver release, remove grab.