Android input: translation layer + look-drag suppression + fork pin #807

Merged
SakulFlee merged 3 commits from fix/android-input into main 2026-09-24 20:04:12 +00:00
Owner

Backend-neutral gamepad input API; IcedCapturedMouseDrag so look-drags starting over iced UI don't rotate the camera (released on button-release/focus-loss); winit pin repointed to the Orbital-Winit fork (Android mouse/joystick/gamepad routing).

Backend-neutral gamepad input API; IcedCapturedMouseDrag so look-drags starting over iced UI don't rotate the camera (released on button-release/focus-loss); winit pin repointed to the Orbital-Winit fork (Android mouse/joystick/gamepad routing).
orbital_input now owns the gamepad vocabulary so every backend speaks
one language at the event boundary:

- GamepadButton: semantic SDL-style set mirroring gilrs' buttons
  (mechanical 1:1 translation in convert_gil_event). Its #[repr(u32)]
  discriminants double as the device-event ABI the mobile winit fork
  will emit through DeviceEvent::Motion/Button.
- InputId::Gamepad(u32) replaces gilrs::GamepadId.
- InputEvent::Gamepad* carry semantic types; gilrs axis mapping moved
  out of InputState::handle_event into convert_gil_event, leaving
  ingestion backend-independent.
- Feature split: gamepad_input (semantic, no dependencies),
  gamepad_gilrs (dep:gilrs, desktop backend), gamepad_input_poll
  (desktop polling). Defaults preserve today's behavior — gilrs stays
  active via gamepad_input_poll — while mobile builds can now drop the
  gilrs dependency entirely.
- convert_device_event is no longer gated behind the gamepad feature
  (mouse deltas shouldn't depend on it) and gains cfg(android/ios)-only
  Motion/Button arms decoding the ABI codes; desktop backends' mouse
  Motion/Button data is never read as gamepad input.

Verified: cargo check/clippy/-D warnings/fmt and tests workspace-wide,
plus aarch64-linux-android and aarch64-apple-ios checks for the
touched crates (mobile arms compile under both cfgs).
Mouse drag-to-look (on Android the winit fork only emits relative
motion while the primary button is held) must not turn the camera
while the user is dragging a UI element. Mirror the touch-capture
mechanism for the mouse path:

- orbital_ecs_bridge: IcedCapturedMouseDrag resource — set when iced
  reports Status::Captured for a primary-button press, cleared on
  release or focus loss.
- orbital_iced: process_events() tracks left-button press/release
  alongside touches and maps per-event statuses onto the resource
  (captures union across renderers, releases clear).
- orbital_app: clear the resource immediately on MouseInput Released
  and on Focused(false) as a missed-release backstop.
- camera: sys_camera_controller gates mouse look on
  CursorGrabState && !IcedCapturedMouseDrag, which needs a fourth Res
  parameter — orbital_ecs gains the Arity-6 IntoSystem impl (4 read
  resources + 2 write components) following the Arity-5 pattern.
chore: repoint winit pin to the Orbital-Winit fork
All checks were successful
Lint / lint (pull_request) Successful in 4m36s
7b3d60be00
The Android input-routing patch (mouse cursor/button/wheel, joystick
device events, gamepad button codes, key text) now lives on
forgejo.sakul-flee.de/SakulFlee/Orbital-Winit branch orbital-input at
rev af2218c9, so builds fetch it instead of iced-rs/winit. HTTPS is
used over SSH because the repo is public and cargo's libssh cannot
authenticate unattended (no agent), while anonymous HTTPS works in
dev and CI alike.
SakulFlee changed title from fix/android-input to Android input: translation layer + look-drag suppression + fork pin 2026-09-24 19:59:11 +00:00
SakulFlee changed target branch from fix/mouse-input-broken to main 2026-09-24 20:03:12 +00:00
Sign in to join this conversation.
No description provided.