Skip to content

Windows Gaming Input support

Paul Hansen requested to merge paul-hansen/gilrs:wgi into master

Description

Fixes: #127 (closed)

This adds a new Windows platform behind a default feature "wgi" ("Windows Gaming Input") and moves the existing Windows platform behind a non-default feature "xinput". xInput is considered legacy at this point and only supported xbox controllers out of the box. It was also causing issues with fast compile enabled in Bevy.

To run the new gui example with wgi:

cargo run --example gui

For running the gui example with xinput:

cargo run --example gui --no-default-features --feature xinput

Features

  • Window's Gamepad mapping support.
  • Controllers without Windows Gamepad mappings will attempt to be mapped using SDL similar to other platforms
  • Added a GUI example. Since WGI requires a focused window, the existing terminal-based examples no longer work on Windows. Note that that some non-xbox controllers still receive events in the terminal-based examples.
  • Force Feedback support for Windows Gamepad mapped devices (non-gamepad devices not supported, could potentially be added later)
  • Power info fully supported
  • Window's concept of "Switches" are mapped to two axes like "Hats" on other platforms.
Edited by Paul Hansen

Merge request reports