r/rust•
cancrizans

Is Gamepad support in Rust even possible?

🙋 seeking help & advice

I think I might be on the brink of insanity with this. I have implemented support for gamepads in my Rust game using the gilrs crate, and it's been in for about a year and a half. As far as I understand, this is the only option, as the gamepads crate wraps gilrs on desktop anyway.

Most of the time gilrs works perfectly, but under some specific but not obscure conditions (running the game after resuming Windows from sleep mode with a gamepad connected) it freezes, see https://gitlab.com/gilrs-project/gilrs/-/work_items/196 .

These are the empirical facts:

  • It is a complete thread lock, it doesn't return an Err nor does it panic. It is completely bricked until the gamepad is physically unplugged.
  • It can be repro'd in the MWE, no game engine and no window, so it doesn't depend on any other component.
  • It happens both to myself and to several of my players.
  • I've never observed this on any other game nor software, so it is Rust-specific.
  • It appears the lockup can be traced to a synchronous call to FromGameController which is from a Windows API (way outside the reach of my knowledge)

This means a chance of a fully frozen black screen with no possibility of a graceful recovery or even displaying an error message. Because of Rust's design, I cannot even detect the lockup. For a videogame, this is pretty much devastating, and now that I'm moving to Stəam I'm considering pulling gamepad support altogether.

But before that I wanted to at least have a quick exchange about it to confirm I'm not missing an obvious solution or anything. It seems strange to me that I can't find anyone else who is fighting this. It can't be that I'm the first person in history to make a game in Rust with gamepad support?

Posted Sep 23, 2026, 8:30 AM UTC

235
Loading comments…