File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,6 @@ Playstation DualShock4 controller hw_version=0x0000b418 fw_version=0x0000a00b
44I could not get Dpad to work with this API but the Sticks works.
55I use the Dpad only around edges but can play without it.
66This is just a way to take the kernel RAW when everything else is not working
7- You might just need to replace this line.
8- device = evdev.InputDevice('/dev/input/event21') # Replace X with the correct number
97
108The quick way:
119sudo modprobe uinput
Original file line number Diff line number Diff line change 22from evdev import UInput , ecodes as e
33
44# Open your PS4 controller device
5- device = evdev .InputDevice ('/dev/input/by-id/usb-Sony_Interactive_Entertainment_Wireless_Controller-if03-event-joystick' ) # Replace
5+ controller_names = (
6+ "Wireless Controller" ,
7+ "Sony Interactive Entertainment Wireless Controller"
8+ )
9+
10+ for device_path in evdev .list_devices ():
11+ device = evdev .InputDevice (device_path )
12+
13+ if any (name in device .name for name in controller_names ):
14+ device = evdev .InputDevice (device .path )
15+ break
616
717# Create a virtual keyboard
818ui = UInput ()
You can’t perform that action at this time.
0 commit comments