Skip to content

Workaround for buttonless Controllers#49

Open
bonkzwonil wants to merge 22 commits intophilipl:masterfrom
bonkzwonil:master
Open

Workaround for buttonless Controllers#49
bonkzwonil wants to merge 22 commits intophilipl:masterfrom
bonkzwonil:master

Conversation

@bonkzwonil
Copy link

Some controllers as the Thrustmaster T-Rudder have no buttons and thus throw an KeyError.
Test buttons first and insert an empty set for the buttons fixes not only this issue but also makes evdevremapkeys and excellent tool to add those controllers to steam/wine/proton, as thats ignoring controllers without buttons :)

To make those work just create an empty mapping like this:

devices:
  - input_name: "Thrustmaster T-Rudder"
    output_name: "T-Rudder"
    remappings: {}

@philipl
Copy link
Owner

philipl commented May 5, 2025

This looks reasonable. Can you please update it to fix the conflict - it's happening due to the new standardised formatting.

@philipl
Copy link
Owner

philipl commented May 5, 2025

Also, please remove the print(caps) that snuck back in, and can you explain the hard-coded button?

bonkzwonil added 3 commits May 7, 2025 12:32
eg:
device:
  - input_name: "Thrustmaster T-Rudder"
    output_name: "T-Rudder"
    product_id: 0x1234
    dummy_buttons: [304, 305]
    remappings: {}
@bonkzwonil
Copy link
Author

I did that and also made it configurable instead of hardcoded.

Explaination for the docs:
wine is picky and ignores devices when they have no buttons, I found it needs at least 2 buttons (ecodes.BTN_A and BTN_B)
Also it looks into the product/vendor ids to map them to xinput/dinput

What now works for my setup for DCS:
I have Thrustmaster Warthog setup with some pedals (Thats the one with no buttons)

My config:

devices:
  - input_name: "Thustmaster Joystick - HOTAS Warthog"
    output_name: "Joystick - HOTAS Warthog"
    remappings: {}
  - input_name: "Thrustmaster Throttle - HOTAS Warthog"
    output_name: "Throttle - HOTAS Warthog"
    remappings: {}
  - input_name: "Thrustmaster T-Rudder"
    output_name: "T-Rudder"
    product_id: 0x1234
    dummy_buttons: [304, 305]
    remappings: {}

This works now (with default product_id it gets ignored). I also added the thrupassing of input ids/product, because some games (like DCS) depend on orginal names and ids (thats why I also added the outputname)

In wine it may be need to get whitelisted as well via wine control

image

But often its not necessary

@bonkzwonil
Copy link
Author

nb: the fixed/passed thru productid was also necessary because otherwise DCS creates a new profile every run (UInput randomizes them otherwise)

Copy link
Owner

@philipl philipl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright.

Please rebase and make sure the change passes linting and formatting. Also, please add an example to the sample file - that's our primary source of documentation.

Thanks.

@bonkzwonil bonkzwonil requested a review from philipl May 30, 2025 14:07
@philipl
Copy link
Owner

philipl commented May 30, 2025

Thanks for updating everything. You still need to rebase onto master before I can merge it as github is reporting conflicts. Also, please update the PR description to reflect the final state, as that will be what is used for the squashed commit.

Thanks again!

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.

2 participants