Skip to content

Instantly share code, notes, and snippets.

@badbabykosh
Last active January 9, 2025 03:19
Show Gist options
  • Save badbabykosh/dc9c978f7634f20e6f69e312487d50a5 to your computer and use it in GitHub Desktop.
Save badbabykosh/dc9c978f7634f20e6f69e312487d50a5 to your computer and use it in GitHub Desktop.
Thrustmaster T-LCM pedals on Linux instructions
  1. get vendor and device Ids via... udevadm info -n /dev/input/by-id/usb-Thrustmaster_Sim_Pedals-event-if00 | grep -E 'ID_VENDOR_ID|ID_MODEL_ID|ID_MODEL''ID_VENDOR_ID|ID_MODEL_ID|ID_MODEL'

  2. Create a file /etc/udev/rules.d/90-pedals-workaround.rules. Add this to the file, changing your vendor and model IDs

    ACTION=="add|change", KERNEL=="event[0-9]*", ENV{ID_VENDOR_ID}=="044f", ENV{ID_MODEL_ID}=="b371", ENV{ID_INPUT_ACCELEROMETER}="", ENV{ID_INPUT_JOYSTICK}="1", TAG+="uaccess"
    
    
  3. Hard reboot computer

  4. Now when you run the following you will see

$ python3 spoof-device.py
Available devices:
/dev/input/event18 Thrustmaster Sim Pedals
/dev/input/event9 VKB-Sim © Alex Oz 2021  VKBsim Gladiator EVO  L  
/dev/input/event31 input-remapper gamepad
^Z
[1]+  Stopped                 python3 spoof-device.py
mage@pop-os ~/evdev-spoof-device on main
$ python3 spoof-device.py "Thrustmaster Sim Pedals"
Available devices:
/dev/input/event18 Thrustmaster Sim Pedals
/dev/input/event9 VKB-Sim © Alex Oz 2021  VKBsim Gladiator EVO  L  
/dev/input/event31 input-remapper gamepad
Using: Thrustmaster Sim Pedals
Spoofing: Traceback (most recent call last):
  File "/home/kosh/evdev-spoof-device/spoof-device.py", line 60, in <module>
    print("Spoofing:", spoofdevice)
  File "/usr/lib/python3/dist-packages/evdev/uinput.py", line 195, in __str__
    evtypes = [i[0] for i in self.capabilities(True).keys()]
  File "/usr/lib/python3/dist-packages/evdev/uinput.py", line 224, in capabilities
    raise UInputError('input device not opened - cannot read capabilities')
evdev.uinput.UInputError: input device not opened - cannot read capabilities
^Z
[2]+  Stopped                 python3 spoof-device.py "Thrustmaster Sim Pedals"
mage@pop-os ~/evdev-spoof-device on main
$ python3 spoof-device.py "Thrustmaster Sim Pedals"
Available devices:
/dev/input/event18 Thrustmaster Sim Pedals
/dev/input/event9 VKB-Sim © Alex Oz 2021  VKBsim Gladiator EVO  L  
/dev/input/event31 input-remapper gamepad
/dev/input/event259 Thrustmaster Sim Pedals PRO
Using: Thrustmaster Sim Pedals
Spoofing: name "Thrustmaster Sim Pedals PRO", bus "BUS_USB", vendor "044f", product "b371", version "0110", phys "py-evdev-uinput"
event types: EV_SYN EV_KEY EV_ABS EV_MSC
Mirroring events...


  1. Pedals are spoofed in the second try...not the first. The scipt hangs on purpose while translating

Notes:

  1. The following Python script creates a virtual device from the real device, adding a few more capabilities to make Star Citizen not discard it as an invalid device: https://github.com/beniwtv/evdev-spoof-device
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment