No description
Find a file
2022-08-15 23:34:20 +03:00
misc Update screenshot and demo 2022-08-15 21:19:36 +03:00
src Add support for Amazon Luna and Google Stadia controllers 2022-08-15 20:58:45 +03:00
.gitignore Add pngs to .gitignore 2022-08-14 04:37:15 +03:00
Cargo.lock Bump to version 1.0.0 2022-08-15 21:31:30 +03:00
Cargo.toml Add some metadata for cargo-bundle 2022-08-15 23:34:20 +03:00
LICENSE Add license, readme 2022-08-14 15:41:35 +03:00
README.md Add support for Amazon Luna and Google Stadia controllers 2022-08-15 20:58:45 +03:00

Gamepad Viewer

Utility program for viewing currently connected gamepads (as seen by SDL). It updates live, tries to show a relatively accurate depiction of your controller, and visualizes pressed down buttons, as well as thumbstick and trigger axises. Requires at least SDL 2.0.12, which introduced the SDL_GameControllerTypeForIndex function used to identify the controllers.

Screenshot

Click on the screenshot for a video demo. No embedded videos in markdown, I guess.

Link to demo

Detected controllers

All controllers SDL sees are displayed, with "Unknown" controllers toggleable by pressing the "U" key or clicking the checkbox at the top of the screen. The following controllers are detected and shown specific sprites for:

  • Xbox 360 (many e.g. Logitech controllers pretend to be this one and are detected as such)
  • Xbox One
  • DualShock 3 (PS3)
  • DualShock 4 (PS4)
  • DualSense (PS5)
  • Switch Pro Controller
  • Amazon Luna
  • Google Stadia

As well as "Virtual", though I don't think those can appear in the wild. As far as I know, those are created in the application itself, and Gamepad Viewer does not.

Currently all the controllers reported by SDL version 2.0.22 are handled. Note that the actual reporting of a specific controller depends on your system SDL recognizing it, this just means that this program can handle everything SDL gives it, up to version 2.0.22.

Issues

There may be discrepancies in the indicated buttons and what you're actually pressing, especially in the Back/Guide/Start buttons, as I only own PS5, Switch Pro, and Xbox 360 clone controllers.

If you come across any issues you'd like to see resolved, feel free to contact me with details, and I'll see if I can get them fixed.

Building

At the very least, you need a Rust toolchain installed, with the Cargo package manager. Then you can either build SDL alongside this program, or link this program against your system SDL.

Using system SDL

Make sure your system's SDL is at least version 2.0.12, and then:

cargo build --release

The executable is ./target/release/gamepad-viewer.

Building SDL on the spot

To build SDL on the spot, you need a C compiler and CMake. Then run:

cargo build --release --features "bundled"

This will compile the SDL dll/so files into the ./target/release directory. You may want to distribute those alongside the executable. If you want to statically link SDL into the executable, add the static-link feature:

cargo build --release --features "bundled static-link"

This is probably the best option for distributing Windows binaries, whereas using the system SDL may be better for Linux, as user systems will probably have SDL installed (or SDL can be made a dependency for this program).

License

This program can be used/studied/redistributed/modified under the terms of the GNU GPLv3 license.