We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b0917cf commit 2a1ceffCopy full SHA for 2a1ceff
fixes/raw_ps4/controller.py
@@ -1,3 +1,4 @@
1
+import sys
2
import evdev
3
from evdev import UInput, ecodes as e
4
@@ -7,13 +8,17 @@
7
8
"Sony Interactive Entertainment Wireless Controller"
9
)
10
11
+device = None
12
for device_path in evdev.list_devices():
- device = evdev.InputDevice(device_path)
-
13
- if any(name in device.name for name in controller_names):
14
- device = evdev.InputDevice(device.path)
+ temp_device = evdev.InputDevice(device_path)
+ if temp_device.name in controller_names:
15
+ device = temp_device
16
break
17
18
+if device == None:
19
+ print("No device found")
20
+ sys.exit(1)
21
+
22
# Create a virtual keyboard
23
ui = UInput()
24
0 commit comments