Skip to main content

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 new PS5 controller.

Installation

Windows

Download hidapi and place the x64 .dll file into your Workspace. After that install the package from pypi.

pip install 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 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 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:

Coming soon

  • add bluetooth support
  • add multiple controllers
  • reading the states of the controller to enable a fully compatibility with python - partially done
  • add documentation using sphinx

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pydualsense-0.6.1.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

pydualsense-0.6.1-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file pydualsense-0.6.1.tar.gz.

File metadata

  • Download URL: pydualsense-0.6.1.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for pydualsense-0.6.1.tar.gz
Algorithm Hash digest
SHA256 74e9074c2abe0259a2dedebd947b7e1bb08221cd28031143a773a931c85019c6
MD5 9e1779db7da4c635fc23f7e73b9595d6
BLAKE2b-256 6ce10d7c354801e2fb3077f0edefd0cbdc3d303ace104ece3af2f9c0b5f7e710

See more details on using hashes here.

Provenance

File details

Details for the file pydualsense-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: pydualsense-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for pydualsense-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f800bb28860c69e3488437edc296e454781358927a1a647131f186ada0cff7f8
MD5 b68132050847102bf2c39babd189aa5d
BLAKE2b-256 631159d7489332a740471db64ed3e4fdf9d1b34aa92d4c4b4a5a5344d6e3a257

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page