ValveSoftware / ValveSoftware/Proton
Prevent joysticks from being seen as gamepads
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 32.8k
- Forks
- 1.6k
- PR merge metrics
- PR metrics pending
Description
Feature Request
I confirm:
- that I haven't found another request for this feature.
- that I have checked whether there are updates for my system available that
contain this feature already.
Description
Currently, joysticks (e.g., my HOTAS with stick, throttle and paddles) is detected as a gamepad. Several games become confused by this, e.g. Batman Arkham Knight only allows the first gamepad detected to be used, so this is usually my HOTAS. Other games just turn the player wildly around because some throttle is offset from an imaginary center point (which a throttle doesn't have). Additionally, the joystick cannot even be used properly as a gamepad input because BTN_{A,B,X,Y} does not exist on those.
Maybe we could add an environment variable which allows to blacklist joysticks per game, or they should generally not be available as xinput devices at all (Proton could detect that by looking if there's a BTN_GAMEPAD event key code in the mapping). This is probably an SDL2 thing, and I'm not sure if Proton could even tell a gamepad from a joystick with SDL2 because it probably only reports axes and buttons but not their original evdev symbolic names.
The core problem is probably that SDL2 treat joysticks and gamepads as the same type of device although they are vastly different input devices. So a proper fix is probably to flag the devices properly in SDL2.
I think there's SDL_GAMECONTROLLER_IGNORE_DEVICES=0xVVVV/0xPPPP,... to do this, I will try that. But Proton could probably make that easier by either automating this or curate a list of devices so that we could easily fix it with a one shot variable, e.g. PROTON_NO_JOYSTICKS=1 %command%.
Justification [optional]
Usage of SDL2 for xinput is probably not even part of Wine, so it's a Proton thing.
Risks [optional]
References [optional]
Related but different use-case: https://github.com/ValveSoftware/Proton/issues/3288
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue names no Proton file, test, or entry point to modify. Start by investigating Proton's SDL2 game-controller handling and the related issue #3288, then determine whether SDL2 can distinguish joysticks from gamepads and which proposed behavior should be implemented.
Written by the indexing model from the issue text.
Assessment
- Domain
- desktop
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100