simvx.core.ui_input

UIInputManager — Handles UI input routing, focus, popups, and hit-testing.

Extracted from SceneTree to separate game-logic concerns (process/draw/groups) from UI input routing (mouse events, keyboard focus, popups, hover tracking).

Module Contents

Classes

UIInputManager

Routes UI input events to controls — focus, hover, mouse grab, popups.

Data

log

API

simvx.core.ui_input.log[source]

‘getLogger(…)’

class simvx.core.ui_input.UIInputManager[source]

Routes UI input events to controls — focus, hover, mouse grab, popups.

Initialization

reset()[source]

Reset transient state (called on scene change).

push_popup(control)[source]

Register a control as an active popup (drawn on top, receives input first).

pop_popup(control)[source]

Unregister a popup control.

ui_input(root: simvx.core.node.Node | None, mouse_pos=None, button: int = 0, pressed: bool = True, key: str = '', char: str = '')[source]

Route UI input events to controls.

touch_input(root: simvx.core.node.Node | None, finger_id: int, action: int, x: float, y: float)[source]

Route a multi-touch event to a specific control.

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.

Args: root: Scene root node. finger_id: Touch finger identifier. action: 0=down, 1=up, 2=move. x, y: Touch position in screen coordinates.