ValveSoftware / steam-devices

List of devices Steam and SteamVR will want read/write permissions on, to help downstream distributions create udev rules/etc
MIT License
141 stars 42 forks source link

Issues with DualShock 4 triggers #57

Open diogotavc opened 2 months ago

diogotavc commented 2 months ago

I was playing some games I had through Bottles and had no issues using my DualShock 4's R2 and L2, but once I installed Steam, my whole button layout changed and tapping R2 or L2 would result in a digital input instead. After some investigation, I've found that it's related to the udev rules which are included with Steam in the form of steam-devices.

https://github.com/ValveSoftware/steam-devices/assets/116651387/e4869d0f-ad60-48b2-863c-6c13aba3792a

https://github.com/ValveSoftware/steam-devices/assets/116651387/e4550bf2-0745-4437-b8f0-c2cefa2c07df

I just want to be able to configure my controller properly, while keeping R2 and L2 as analogue inputs. Any and all help would be massively appreciated!

diogotavc commented 2 months ago

In the meantime, I found a way to get around the udev rules without removing them altogether. The idea is to create a rule with higher priority that resets all changes that steam-devices makes to DualShock 4 controllers when they're connected.

diogo@dingus-pad:~$ cat /etc/udev/rules.d/61-ds4-bypass-steam-input.rules
# DualShock 4 over USB hidraw
KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="05c4", MODE="", TAG:=""

# DualShock 4 wireless adapter over USB hidraw
KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="0ba0", MODE="", TAG:=""

# DualShock 4 Slim over USB hidraw
KERNEL=="hidraw*", ATTRS{idVendor}=="054c", ATTRS{idProduct}=="09cc", MODE="", TAG:=""

# DualShock 4 over bluetooth hidraw
KERNEL=="hidraw*", KERNELS=="*054C:05C4*", MODE="", TAG:=""

# DualShock 4 Slim over bluetooth hidraw
KERNEL=="hidraw*", KERNELS=="*054C:09CC*", MODE="", TAG:=""
diogo@dingus-pad:~$ sudo udevadm control --reload-rules
diogo@dingus-pad:~$ sudo udevadm trigger

Note that Steam still recognises my inputs just fine in big picture mode, which I don't recall working when the package was absent.

Update: Steam Input detects my controller and works as intended (a few test remaps worked fine).