Combine multiple devices in to one generic joystick

Hello.

I’ve been playing with an Adafruit Feather RP2040 trying to combine two Thrustmaster T.16000M joysticks & Thrustmaster T3PA pedals in to one generic joystick device.

It seems HID Remapper can emulate KBM or console controllers, but I haven’t found a way to make it emulate a generic joystick so that I could map:

  • left joystick x, y & z axis to generic joystick axis 0, 1 & 2
  • right joystick x, y & z axis to generic joystick axis 3, 4 & 5
  • pedals accelerator axis to generic joystick axis 6
  • pedals brake axis to generic joystick axis 7
  • left joystick 1, 2, 3 & 4 buttons to generic joystick buttons 0, 1, 2 & 3
  • right joystick 1, 2, 3 & 4 buttons to generic joystick buttons 4, 5, 6 & 7
  • left joystick 4 way hat switch to generic joystick buttons 8-11
  • right joystick 4 way hat switch to generic joystick buttons 12-15

Is this at all possible with HID remapper or should I be looking elsewhere for this functionality?

Thank for your time.

HID Remapper can emulate the devices you can see in the “Emulated device type” dropdown. For example the “PS4 arcade stick” device type has 14 buttons and 6 axes, which you can map to any way you like (including per-device). If you need more you’d have to make a custom build of the firmware.

I have tried using the PS4 emulation but there’s not enough buttons available for both T.16000m sticks (4 buttons + 4 button HAT for each).

I have a solid knowledge of C & C++ so I’d be happy to add in a generic joystick as a new emulated type, even put it up as a PR should you be interested in merging it after extensive testing.

Could you point me to where I would start with your code? An outline of how to accomplish that? I’ve been looking over it all but a basic explanation would be real helpful.

You’d need to change or add an HID report descriptor in our_descriptors.cc.

What’s your use case for this? I can’t think of a piece of software that would know what to do with so many joystick axes, but wouldn’t also support multiple devices at the same time.

Star Citizen. When you have multiple devices (two sticks & pedals & a throttle) all plugged in their IDs in game (joystick1, 2, 3 etc) can get mixed up from one game launch to the next. You then have to either rebind everything all over again or use a console command multiple times to swap the assignments between joystick numbers. Then check your curves & axis inversion settings. When you just want to set it up once so you can always sit down & play whenever you get a spare moment, it can be very frustrating & time consuming.

On Windows, people use vjoy & joystick gremlin to combine their devices in to one virtual device so Star Citizen can’t mix it up with another joystick since it sees only one.

I run Linux, so I can’t use those applications. I have tried input remapper, but because the USB IDs are identical for both left & right sticks (thanks Thrustmaster) it doesn’t work.

So I heard of your project & how you can assign based on USB hub port # & thought that’d fix my problem.

It does work when I use the PS4 emulation, I just don’t have enough buttons or axis to assign for my use case.

If there was an emulation for a generic joystick, with the maximum number of axis & buttons supported by one device, then that would work for not only my sticks but others who have sticks with more buttons/hats assessible to them.

I see. Well like I said, you’d have to add more axes and buttons to the report descriptor that HID Remapper uses. You can just modify the PS4 one if you don’t care about it working with an actual PlayStation in the future. The web configurator should pick up the extra inputs automatically.

As (1) a total noob to HID-Remapper and (2) someone who has never played Star Citizen; is there a reason you can’t configure your sticks to act as a combination of PS4 controller and keyboard?

I just noticed that doesn’t get you as many axis as you asked for, though.