Gamepad on Windows

sigh will have to do something terrible about this, one way or another not going to be elegant.

Is there anything I can help with?

thanks for the offer. don’t know how comfortable you are with a bit of c programming. what i would do is try to interleave the extra joystick polling thread into the operation of the main thread. i.e. somewhere in gui/main.c replace glfwWaitEvents() with something that wakes up frequently (don’t know vkdt needs the full 8k polling rate of excellent controllers… also this is for waking up only, the loop will stay awake for a while after detecting changes). then check the game controller, if there is change process the rest of the loop, if not go right back to sleep or some such.

A bit rusty these days but hopefully still good enought for the PR. Let me know on github or here if it needs work!

1 Like

thanks! i think this code looks really good. indeed better than it was before. extra threads are terrible too and the patch is a net minus in number of lines of code :slight_smile: i patched a few other things in too. in particular the new polling rate makes my gamepad much more sensitive now, so i tuned that down. might need to expose the sensitivity as a user parameter.