simvx.core.input.web_events¶
Decode the browser input wire format into :class:InputRouter calls.
Two paths deliver input from a browser: the exported static page
(simvx.web) and the streaming dev client (simvx.graphics.streaming).
Both page scripts serialise the same JSON events, so both decode here.
Event shapes, all keys optional with the defaults shown:
=========== =========================================================
key code (engine key code), pressed, repeat
char codepoint
mouse button (DOM ordering), pressed
mousemove````x/y, or dx/dy with relative under pointer lock
scroll dx, dy (positive dy scrolls up)
touch id, action (0=down, 1=up, 2=move), x, y, pressure
=========== =========================================================
Any event may carry ctrl/shift/alt/meta modifier flags.
Module Contents¶
Functions¶
Route a batch of browser input events through router. |
Data¶
API¶
- simvx.core.input.web_events.log¶
‘getLogger(…)’
- simvx.core.input.web_events.route_browser_events(router: simvx.core.input.router.InputRouter, events: collections.abc.Iterable[dict[str, Any]]) None[source]¶
Route a batch of browser input events through router.
Args: router: The :class:
InputRouterbound to the running scene tree. events: Decoded JSON event objects, in the order the page sent them.
- simvx.core.input.web_events.__all__¶
[‘route_browser_events’]