Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make joysticks work on background in the Electron version #1703

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rafaellehmkuhl
Copy link
Member

@rafaellehmkuhl rafaellehmkuhl commented Feb 19, 2025

This is a long term desire from the users and it should be fulfilled with this PR.

It aims to solve the problem of losing the joystick connection when the standalone application (electron-version) window is minimized or completely obfuscated.

To solve this problem we need to access the joysticks via its HID interface. Different from the Gamepad API, the HID data is updated even when the window is not visible.

The biggest challenge is that, different from the Gamepad API, where there is a standardized access for buttons and axes, the HID state is completely different from one joystick to another. The HID buffer basically exposes the data as the manufacturer decided to, so we need to have dedicated mappings for each joystick, and we probably want to offer a UI that allows the user to map its own joystick as well.

My goal is to work on this PR in parallel during this quarter, and continue on it as a priority in the next one.

TODO:

  • 1. List available joysticks in the Main process
  • 2. Gather state data from those joysticks
  • 3. Stream this data to the Renderer process
  • 4. Allow the user to enable/disable the use of the HID data
  • 5. Allow users with a Blue Xbox Controller or a Dual Sense to use them via the HID interface
  • 6. Add an UI to allow users to map their own joysticks

Fix #1701

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Joystick should work even when the application is minimized or in background (electron-only)
1 participant