Examples, closing controller HID device on close function

This commit is contained in:
Florian Kaiser
2020-11-29 19:40:37 +01:00
parent a353bb006a
commit 2f5579cc49
5 changed files with 59 additions and 23 deletions

View File

@@ -0,0 +1,12 @@
from pydualsense import *
# get dualsense instance
dualsense = pydualsense()
# set left trigger mode to rigid and put some force values on it
dualsense.setLeftTriggerMode(TriggerModes.Rigid)
dualsense.setLeftTriggerForce(1, 255)
# sleep a little to see the result on the controller
# this is not needed in normal usage
import time; time.sleep(2)
# terminate the thread for message and close the device
dualsense.close()