1

I'm trying to find joystick state in a cross platform way - developing on windows - using Golang. I'm currently looking to use the joystick API at https://github.com/0xcafed00d/joystick

However, for Go on windows, I don't know how to find the id that I need for joystick.Open(joy_id).

Does anyone know of a Go API that allows me to get a list of currently plugged in joysticks/gamepads so I can iterate through their ids? I don't mind if this is just for Windows. N.B. I'm happy to use standard windows libraries or Go packages, but don't want to have to install anything, e.g. SDL 2, since the target users are non technical.

Note 2: I've originally did this with the browser Gamepad API - but the gamepad API is suspended when the browser window is in the background/minimized.

AndyS
  • 725
  • 7
  • 17
  • maybe that will help you https://stackoverflow.com/questions/60662743/how-do-i-use-win32s-getrawinputdevicelist-in-go –  Jun 06 '22 at 07:21

0 Answers0