reading input of PS5 controller using pydualsense get error and unable to read after running few secounds. error code has more than this, i just paste here top of them
from pydualsense import *
def input_check():
dualsense = pydualsense()
dualsense.init()
keys = []
while True:
...
if dualsense.state.options:
keys.append('option')
return 'option'
elif dualsense.state.ps:
keys.append('ps')
return 'ps'
elif dualsense.state.triangle:
keys.append('triangle')
return 'triangle'
elif dualsense.state.square:
keys.append('square')
return 'square'
elif dualsense.state.cross:
keys.append('cross')
return 'cross'
elif dualsense.state.circle:
keys.append('circle')
return 'circle'
# close device
dualsense.close()
while True:
input = input_check()
print(input)
this is error code
Exception in thread Thread-113:
Traceback (most recent call last):
File "E:\anaconda3\envs\fifabot\lib\threading.py", line 980, in _bootstrap_inner
Exception in thread Thread-373:
Traceback (most recent call last):
File "E:\anaconda3\envs\fifabot\lib\threading.py", line 980, in _bootstrap_inner
self.run()
File "E:\anaconda3\envs\fifabot\lib\threading.py", line 917, in run
self.run()
File "E:\anaconda3\envs\fifabot\lib\threading.py", line 917, in run
I have self sloved it. code should be like this