Skip to content

Prevent joysticks from being seen as gamepads #4579

@kakra

Description

@kakra

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: #3288

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions