4 Commits

Author SHA1 Message Date
Florian Kaiser
24c628a182 Update package version 2021-06-28 23:04:55 +02:00
Florian Kaiser
36e8886754 Update version 2021-06-28 23:03:23 +02:00
Florian Kaiser
28605e0023 Update with linux support over usb 2021-06-28 23:00:22 +02:00
Florian Kaiser
f5529f1463 Add state for microphone button 2021-03-07 21:40:55 +01:00
2 changed files with 14 additions and 6 deletions

View File

@@ -1,7 +1,9 @@
# needed for python > 3.8
import os, sys
if sys.platform.startswith('win32') and sys.version_info >= (3,8):
from sys import platform
if platform.startswith('Windows') and sys.version_info >= (3,8):
os.add_dll_directory(os.getcwd())
import hidapi
@@ -28,7 +30,12 @@ class pydualsense:
self.state = DSState() # controller states
self.conType = self.determineConnectionType() # determine USB or BT connection
if platform.startswith('Windows'):
self.conType = self.determineConnectionType() # determine USB or BT connection
else:
# set for usb manually
self.input_report_length = 64
self.output_report_length = 64
# thread for receiving and sending
@@ -185,6 +192,7 @@ class pydualsense:
misc2 = states[10]
self.state.ps = (misc2 & (1 << 0)) != 0
self.state.touchBtn = (misc2 & 0x02) != 0
self.state.micBtn = (misc2 & 0x04) != 0
# trackpad touch
@@ -262,7 +270,7 @@ class pydualsense:
# set Micrphone LED, setting doesnt effect microphone settings
outReport[9] = self.audio.microphone_led # [9]
outReport[10] = 0x10 if self.audio.microphone_state == True else 0x00
outReport[10] = 0x10 if self.audio.microphone_mute == True else 0x00
# add right trigger mode + parameters to packet
outReport[11] = self.triggerR.mode.value
@@ -500,7 +508,7 @@ class DSAudio:
raise TypeError('state needs to be bool')
self.setMicrophoneLED(state) # set led accordingly
self.microphone_state = state
self.microphone_mute = state
class DSTrigger:

View File

@@ -6,7 +6,7 @@ with open("README.md", "r") as fh:
setup(
name='pydualsense',
version='0.5.2',
version='0.5.5',
description='use your DualSense (PS5) controller with python',
long_description=long_description,
long_description_content_type="text/markdown",
@@ -14,5 +14,5 @@ setup(
author='Florian K',
license='MIT License',
packages=setuptools.find_packages(),
install_requires=['hidapi-usb', 'cffi']
install_requires=['hidapi-usb>=0.3', 'cffi']
)