Skip to content

Emit Android joystick axes as device motion events#4618

Open
brianconnoly wants to merge 1 commit into
rust-windowing:masterfrom
brianconnoly:vss/android-joystick-axes-master
Open

Emit Android joystick axes as device motion events#4618
brianconnoly wants to merge 1 commit into
rust-windowing:masterfrom
brianconnoly:vss/android-joystick-axes-master

Conversation

@brianconnoly

Copy link
Copy Markdown

Summary

  • add a raw DeviceEvent::Motion { axis, value } event for device-specific analog axes
  • route Android joystick/gamepad MotionEvent samples before the touch path
  • emit motion values for common joystick, hat and analog trigger axes

This lets Android gamepad sticks, D-pad hats and analog triggers reach applications without being dropped as touch input. The Android backend reports the raw Android axis IDs so applications can map controller layouts themselves.

Validation

  • git diff --check
  • CARGO_TARGET_DIR=/Volumes/RustBuilds/vibe-scrap-squad/target/winit-fork-master CARGO_INCREMENTAL=0 cargo check -p winit --target aarch64-linux-android --features android-native-activity

Note: cargo fmt --check requires this repository's nightly rustfmt configuration. This machine only has stable installed, and stable rustfmt reports unrelated repository-wide formatting diffs when reading the upstream config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant