Update DualSense controllers. /JL

This commit is contained in:
2025-04-20 12:08:16 +02:00
parent 1d65c88a7b
commit ce694b3625
4 changed files with 14 additions and 14 deletions

View File

@@ -9,7 +9,7 @@ from .xbox_series_x_controller import XboxSeriesXController
from .generic_controller import GenericController
from .logitech_dual_action_controller import LogitechDualActionController
__version__ = "0.0.6"
__version__ = "0.0.7"
CONTROLLERS = {
"DualSense Wireless Controller": DualSenseController,

View File

@@ -18,12 +18,12 @@ class DualSenseController(ControlsBase):
self.powerlevel = self.device.battery.Level
self.batterystate = BATTERY_STATE[str(self.device.battery.State)]
self.set_player_id(PlayerID.PLAYER_1)
self.numaxis: int = self.device.get_numaxes()
self.axis: list = [self.device.get_axis(a) for a in range(self.numaxis)]
self.numhats: int = self.device.get_numhats()
self.hats: list = [self.device.get_hat(h) for h in range(self.numhats)]
self.numbuttons: int = self.device.get_numbuttons()
self.buttons: list = [self.device.get_button(b) for b in range(self.numbuttons)]
self.numaxis: int = joy.get_numaxes()
self.axis: list = [joy.get_axis(a) for a in range(self.numaxis)]
self.numhats: int = joy.get_numhats()
self.hats: list = [joy.get_hat(h) for h in range(self.numhats)]
self.numbuttons: int = joy.get_numbuttons()
self.buttons: list = [joy.get_button(b) for b in range(self.numbuttons)]
self.mapping = {
"left stick x": self.axis[0],
"left stick y": self.axis[1],

View File

@@ -10,12 +10,12 @@ class DualSenseEdgeController(ControlsBase):
self.powerlevel = self.device.battery.Level
self.batterystate = BATTERY_STATE[str(self.device.battery.State)]
self.set_player_id(PlayerID.PLAYER_1)
self.numaxis: int = self.device.get_numaxes()
self.axis: list = [self.device.get_axis(a) for a in range(self.numaxis)]
self.numhats: int = self.device.get_numhats()
self.hats: list = [self.device.get_hat(h) for h in range(self.numhats)]
self.numbuttons: int = self.device.get_numbuttons()
self.buttons: list = [self.device.get_button(b) for b in range(self.numbuttons)]
self.numaxis: int = joy.get_numaxes()
self.axis: list = [joy.get_axis(a) for a in range(self.numaxis)]
self.numhats: int = joy.get_numhats()
self.hats: list = [joy.get_hat(h) for h in range(self.numhats)]
self.numbuttons: int = joy.get_numbuttons()
self.buttons: list = [joy.get_button(b) for b in range(self.numbuttons)]
self.mapping = {
"left stick x": self.axis[0],
"left stick y": self.axis[1],

View File

@@ -3,7 +3,7 @@ if __name__ == "__main__":
setup(
name='pygameControls',
version='0.0.6',
version='0.0.7',
packages=find_packages(),
install_requires=[],
author='Jan Lerking',