retrohub-org / retrohub

Retrogaming library frontend, built to be a highly customizable platform.
https://retrohub-org.github.io/
MIT License
110 stars 6 forks source link

Input still recognized while out of focus #36

Closed rsubtil closed 1 year ago

rsubtil commented 1 year ago

RetroHub is still picking up joystick input when the app is out of focus. This is problematic as it can change settings in the background and mess things up without the user noticing. Input should only be accepted when the app is focused (this is not an issue with keyboard/mouse as the OS manages app focus instead)

rsubtil commented 1 year ago

This may require changes in Godot due to UI events. There's https://github.com/godotengine/godot/issues/16832 which points to a commit that might be easily cherry-pickable.

For now, it might be sufficient to handle this in code and avoid opening UI elements when out-of-focus. This however might not solve all issues if there's existing UI elements. A solution will be tried, but if more issues arise of this, it's better to patch Godot altogether.

rsubtil commented 1 year ago

Fixed with https://github.com/retrohub-org/retrohub/commit/c7dad0463e6694cdfc4545272b1b11bd1b0fd08a