Skip to content

Commit

Permalink
deploy: 5238a1f
Browse files Browse the repository at this point in the history
  • Loading branch information
flok committed Mar 2, 2024
0 parents commit 5455f87
Show file tree
Hide file tree
Showing 55 changed files with 6,987 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .buildinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 23a1ffe8f800ed1227cdb68dedead008
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file added .doctrees/api.doctree
Binary file not shown.
Binary file added .doctrees/ds_enum.doctree
Binary file not shown.
Binary file added .doctrees/ds_eventsystem.doctree
Binary file not shown.
Binary file added .doctrees/ds_main.doctree
Binary file not shown.
Binary file added .doctrees/environment.pickle
Binary file not shown.
Binary file added .doctrees/examples.doctree
Binary file not shown.
Binary file added .doctrees/index.doctree
Binary file not shown.
Binary file added .doctrees/modules.doctree
Binary file not shown.
Binary file added .doctrees/pydualsense.doctree
Binary file not shown.
Binary file added .doctrees/usage.doctree
Binary file not shown.
Empty file added .nojekyll
Empty file.
10 changes: 10 additions & 0 deletions _sources/api.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
API
===

This is the front page for the API documentation of the **pydualsense** library.


.. toctree::
ds_enum
ds_main
ds_eventsystem
11 changes: 11 additions & 0 deletions _sources/ds_enum.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
pydualsense enums classes
=========================

The enum module provides the used `enums` by **pydualsense**. These `enums` are used to update the state of the controller as a parameter to call the used functions.


.. automodule:: pydualsense.enums
:noindex:
:members:
:undoc-members:
:show-inheritance:
10 changes: 10 additions & 0 deletions _sources/ds_eventsystem.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
pydualsense event system classes
================================

The `Event System` implements the event system used for the button callbacks

.. automodule:: pydualsense.event_system
:noindex:
:members:
:undoc-members:
:show-inheritance:
11 changes: 11 additions & 0 deletions _sources/ds_main.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
pydualsense main class
======================

`pydualsense` is the main class of the library with the same name. It provides access to the states of the controller through manual reading of the :class:`DSState <pydualsense.pydualsense.DSState>`


.. automodule:: pydualsense.pydualsense
:noindex:
:members:
:undoc-members:
:show-inheritance:
82 changes: 82 additions & 0 deletions _sources/examples.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
Examples
========

This pages displays some examples that on how the library can be used. All the examples can also be found inside the `examples` folder on the github repository.

.. code-block:: python
from pydualsense import *
def cross_down(state):
print(f'cross {state}')
def circle_down(state):
print(f'circle {state}')
def dpad_down(state):
print(f'dpad down {state}')
def joystick(stateX, stateY):
print(f'joystick {stateX} {stateY}')
def gyro_changed(pitch, yaw, roll):
print(f'{pitch}, {yaw}, {roll}')
# create dualsense
dualsense = pydualsense()
# find device and initialize
dualsense.init()
# add events handler functions
dualsense.cross_pressed += cross_down
dualsense.circle_pressed += circle_down
dualsense.dpad_down += dpad_down
dualsense.left_joystick_changed += joystick
dualsense.gyro_changed += gyro_changed
# read controller state until R1 is pressed
while not dualsense.state.R1:
...
# close device
dualsense.close()
The above example demonstrates the newly added c# like event system that makes it possible to trigger an event for the inputs of the controller.


.. code-block:: python
from pydualsense import *
# get dualsense instance
dualsense = pydualsense()
# initialize controller and connect
dualsense.init()
print('Trigger Effect demo started')
# set left and right rumble motors
dualsense.setLeftMotor(255)
dualsense.setRightMotor(100)
# set left l2 trigger to Rigid and set index 1 to force 255
dualsense.triggerL.setMode(TriggerModes.Rigid)
dualsense.triggerL.setForce(1, 255)
# set left r2 trigger to Rigid
dualsense.triggerR.setMode(TriggerModes.Pulse_A)
dualsense.triggerR.setForce(0, 200)
dualsense.triggerR.setForce(1, 255)
dualsense.triggerR.setForce(2, 175)
# loop until r1 is pressed to feel effect
while not dualsense.state.R1:
...
# terminate the thread for message and close the device
dualsense.close()
26 changes: 26 additions & 0 deletions _sources/index.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Welcome to pydualsense's documentation!
=======================================


**pydualsense** is a Python library that helps you interact with your PlayStation 5 DualSense controller. It reads the current state of the controller and also allows to update the triggers and other options on the controller.

To get started check out the :doc:`usage` section for more information on how to install.


.. note::
This project is under active development.

Contents
--------

.. toctree::
usage
api
examples
modules


TODOs
-----

.. todolist::
7 changes: 7 additions & 0 deletions _sources/modules.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pydualsense
===========

.. toctree::
:maxdepth: 4

pydualsense
45 changes: 45 additions & 0 deletions _sources/pydualsense.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
pydualsense package
===================

Submodules
----------

pydualsense.enums module
------------------------

.. automodule:: pydualsense.enums
:members:
:undoc-members:
:show-inheritance:

pydualsense.event\_system module
--------------------------------

.. automodule:: pydualsense.event_system
:members:
:undoc-members:
:show-inheritance:

pydualsense.hidguardian module
------------------------------

.. automodule:: pydualsense.hidguardian
:members:
:undoc-members:
:show-inheritance:

pydualsense.pydualsense module
------------------------------

.. automodule:: pydualsense.pydualsense
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: pydualsense
:members:
:undoc-members:
:show-inheritance:
38 changes: 38 additions & 0 deletions _sources/usage.rst.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Usage
=====

Installation
------------

To use **pydualsense**, first install it using pip:

.. code-block:: console
(.venv) $ pip install --upgrade pydualsense
This install the needed dependencies and the **pydualsense** library itself.


Windows
-------

If you are on Windows the hidapi need to downloaded from `here <https://github.com/libusb/hidapi/releases>`_.
The downloaded `.dll` file need to be placed in a path that is in your environments variable `path`.


Linux based
-----------

If you are on a linux based system (e.g debian) you need to first need to install the hidapi through your package manager.

On Ubuntu systems the package `libhidapi-dev` is required.

.. code-block:: console
sudo apt install libhidapi-dev
Examples
--------

For code examles on using the library see :doc:`examples`
Loading

0 comments on commit 5455f87

Please sign in to comment.