use your DualSense (PS5) controller with python
Project description
pydualsense
control your dualsense through python. using the hid library this package implements the report features for controlling your PS5 controller.
Documentation
You can find the documentation at docs
Installation
Windows
Download hidapi and place the x64 .dll file into your Workspace. After that install the package from pypi.
pip install --upgrade pydualsense
Linux
On Linux based system you first need to install the hidapi through your package manager of your system.
On an Ubuntu system the package libhidapi-dev
is required.
sudo apt install libhidapi-dev
After that install the package from pypi.
pip install --upgrade pydualsense
usage
from pydualsense import pydualsense, TriggerModes
def cross_pressed(state):
print(state)
ds = pydualsense() # open controller
ds.init() # initialize controller
ds.cross_pressed += cross_pressed
ds.light.setColorI(255,0,0) # set touchpad color to red
ds.triggerL.setMode(TriggerModes.Rigid)
ds.triggerL.setForce(1, 255)
ds.close() # closing the controller
See examples or examples docs folder for some more ideas
Help wanted
Help wanted from people that want to use this and have feature requests. Just open a issue with the correct label.
dependecies
- hidapi-usb >= 0.3
Credits
Most stuff for this implementation were provided by and used from:
- https://www.reddit.com/r/gamedev/comments/jumvi5/dualsense_haptics_leds_and_more_hid_output_report/
- https://github.com/Ryochan7/DS4Windows
Coming soon
- add bluetooth support
- add multiple controllers
- partially done
- add documentation using sphinx
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pydualsense-0.6.3.tar.gz
.
File metadata
- Download URL: pydualsense-0.6.3.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f05c52eecf8129e752bb3b1f13d64407d10b69903d4f94aa8b42346b3309e838 |
|
MD5 | f1d3d5af478ce303bb5d18d908e3e199 |
|
BLAKE2b-256 | 8feec088261654df74bdf216762bf0a22d3f4117914d98be8c5e5d8d553b7cc6 |
Provenance
File details
Details for the file pydualsense-0.6.3-py3-none-any.whl
.
File metadata
- Download URL: pydualsense-0.6.3-py3-none-any.whl
- Upload date:
- Size: 11.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca886bd18b018650a4908fe150e729cc4949a9815e137ad3436dcc560695227e |
|
MD5 | 8503dbd960b62f10dcf7a1ac7e1f8356 |
|
BLAKE2b-256 | 4ac0a70f9c7db61593fe09a79d50dcab5e3919a619a065b7ed6c39c62a925dc8 |