evdevremapkeys icon indicating copy to clipboard operation
evdevremapkeys copied to clipboard

Workaround for buttonless Controllers

Open bonkzwonil opened this issue 7 months ago • 5 comments

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: {}

bonkzwonil avatar May 05 '25 07:05 bonkzwonil

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

philipl avatar May 05 '25 20:05 philipl

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

philipl avatar May 05 '25 20:05 philipl

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 avatar May 07 '25 10:05 bonkzwonil

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

bonkzwonil avatar May 07 '25 10:05 bonkzwonil

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!

philipl avatar May 30 '25 19:05 philipl