Expand description
Shared runner helpers extracted from duplicated desktop/web/android App impls.
Structs§
- Backend
Lifecycle - Retry policy for GPU backend construction, shared by every runner so the
attempt cap and backoff curve stay identical across platforms. Callers keep
their own clock and absolute retry deadline, since
Instantdiffers on wasm. - Touch
Result - Raw touch result without dispatch - caller handles
dispatch_actionto avoid double-borrow.
Enums§
Constants§
- MAX_
BACKEND_ INIT_ ATTEMPTS - Adapter creation is retried a few times because a platform may still be bringing up its GPU process. A capability problem (no supported backend, blocklisted driver) never resolves, so stop after this many tries.
Functions§
- handle_
touch_ raw - map_
mouse_ button - Map winit MouseButton -> PointerButton.
- map_
physical_ key - Typed physical position for a winit key (
Nonewraps torepose_core::input::PhysicalKey::Unidentified, neverNone: every physical press has a position). Backs both theKeyEventfield and theScheduler::held_keyssnapshot. - on_
cursor_ moved - CursorMoved helper - returns cursor + whether inspector hover updated.
- on_ime
- Ime dispatch helper.
- on_
key_ parts - Same dispatch as
on_keyboard_input, for runners that cannot hand over awinit::event::KeyEvent(it has no public constructor): synthetic keys and keys forwarded from a DOM element. - on_
keyboard_ input - Shared inspector toggle + runtime dispatch.
Reports the raw physical transition to the polled
held_keysset first (games read held keys GML-style without depending on focus), then dispatches the focus-routed key event as before. Returns true if event consumed / needs redraw. - on_
modifiers_ changed - Update
Modifiersfrom winit state - shared. - on_
mouse_ wheel - MouseWheel helper - converts delta to px and dispatches.
- on_
touch - HACK: Legacy wrapper that dispatches gestures inline (use
handle_touch_rawwhen caller needs to avoid double-borrow ofselfcontainingrt). - on_
touch_ with_ ime - Touch handler that also syncs IME for focused textfields on native runners. The web backend has no editor bridge, so its touch path only dispatches input.
- physical_
key_ name - Stable debug name for a physical key (
KeyW,Digit1,Space, …), matchingKeyCode’s variant names. Layout-independent: AZERTY/QWERTZ report the same physical names, so games bind by position the way GML’sord("W")binds the US position. - sync_
touch_ points - Publish the live contact table into
sched.touch_points(single sync point: every runner funnels raw touch throughhandle_touch_raw). Games snapshot it each frame, so held fingers stay visible across frames (unlike the press edge, which fires once and is gone). GMLdevice_mouse_*parity: stable per-finger ids, physical-px positions sampled every tick while held.