pygameControls 0.1.11__tar.gz → 0.1.12__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pygamecontrols-0.1.11 → pygamecontrols-0.1.12}/PKG-INFO +1 -1
- {pygamecontrols-0.1.11 → pygamecontrols-0.1.12}/pygameControls/controller.py +4 -2
- pygamecontrols-0.1.12/pygameControls/dualshock3_controller.py +70 -0
- {pygamecontrols-0.1.11 → pygamecontrols-0.1.12}/pygameControls.egg-info/PKG-INFO +1 -1
- {pygamecontrols-0.1.11 → pygamecontrols-0.1.12}/pygameControls.egg-info/SOURCES.txt +1 -0
- {pygamecontrols-0.1.11 → pygamecontrols-0.1.12}/setup.py +1 -1
- {pygamecontrols-0.1.11 → pygamecontrols-0.1.12}/LICENSE +0 -0
- {pygamecontrols-0.1.11 → pygamecontrols-0.1.12}/README.md +0 -0
- {pygamecontrols-0.1.11 → pygamecontrols-0.1.12}/pygameControls/__init__.py +0 -0
- {pygamecontrols-0.1.11 → pygamecontrols-0.1.12}/pygameControls/controlsbase.py +0 -0
- {pygamecontrols-0.1.11 → pygamecontrols-0.1.12}/pygameControls/dualsense_controller.py +0 -0
- {pygamecontrols-0.1.11 → pygamecontrols-0.1.12}/pygameControls/dualsense_edge_controller.py +0 -0
- {pygamecontrols-0.1.11 → pygamecontrols-0.1.12}/pygameControls/generic_controller.py +0 -0
- {pygamecontrols-0.1.11 → pygamecontrols-0.1.12}/pygameControls/logitech_dual_action_controller.py +0 -0
- {pygamecontrols-0.1.11 → pygamecontrols-0.1.12}/pygameControls/logitech_f310_controller.py +0 -0
- {pygamecontrols-0.1.11 → pygamecontrols-0.1.12}/pygameControls/logitech_f510_controller.py +0 -0
- {pygamecontrols-0.1.11 → pygamecontrols-0.1.12}/pygameControls/logitech_f710_controller.py +0 -0
- {pygamecontrols-0.1.11 → pygamecontrols-0.1.12}/pygameControls/xbox_series_x_controller.py +0 -0
- {pygamecontrols-0.1.11 → pygamecontrols-0.1.12}/pygameControls.egg-info/dependency_links.txt +0 -0
- {pygamecontrols-0.1.11 → pygamecontrols-0.1.12}/pygameControls.egg-info/top_level.txt +0 -0
- {pygamecontrols-0.1.11 → pygamecontrols-0.1.12}/setup.cfg +0 -0
@@ -6,10 +6,11 @@ from .logitech_f310_controller import LogitechF310Controller
|
|
6
6
|
from .logitech_f510_controller import LogitechF510Controller
|
7
7
|
from .logitech_f710_controller import LogitechF710Controller
|
8
8
|
from .xbox_series_x_controller import XboxSeriesXController
|
9
|
+
from .dualshock3_controller import DualShock3Controller
|
9
10
|
from .generic_controller import GenericController
|
10
11
|
from .logitech_dual_action_controller import LogitechDualActionController
|
11
12
|
|
12
|
-
__version__ = "0.1.
|
13
|
+
__version__ = "0.1.12"
|
13
14
|
|
14
15
|
CONTROLLERS = {
|
15
16
|
"DualSense Wireless Controller": DualSenseController,
|
@@ -18,7 +19,8 @@ CONTROLLERS = {
|
|
18
19
|
"Logitech Gamepad F510": LogitechF510Controller,
|
19
20
|
"Logitech Gamepad F710": LogitechF710Controller,
|
20
21
|
"Logitech Dual Action": LogitechDualActionController,
|
21
|
-
"Xbox Series X Controller": XboxSeriesXController
|
22
|
+
"Xbox Series X Controller": XboxSeriesXController,
|
23
|
+
"PLAYSTATION(R)3 Controller": DualShock3Controller
|
22
24
|
}
|
23
25
|
|
24
26
|
class Controllers:
|
@@ -0,0 +1,70 @@
|
|
1
|
+
from pygameControls.controlsbase import ControlsBase
|
2
|
+
|
3
|
+
class DualShock3Controller(ControlsBase):
|
4
|
+
def __init__(self, joy):
|
5
|
+
self.device = joy
|
6
|
+
self.instance_id: int = self.device.get_instance_id()
|
7
|
+
self.name = self.device.get_name()
|
8
|
+
self.guid = self.device.get_guid()
|
9
|
+
self.numaxis: int = self.device.get_numaxes()
|
10
|
+
self.axis: list = [self.device.get_axis(a) for a in range(self.numaxis)]
|
11
|
+
self.numhats: int = self.device.get_numhats()
|
12
|
+
self.hats: list = [self.device.get_hat(h) for h in range(self.numhats)]
|
13
|
+
self.numbuttons: int = self.device.get_numbuttons()
|
14
|
+
self.buttons: list = [self.device.get_button(b) for b in range(self.numbuttons)]
|
15
|
+
self.mapping = {
|
16
|
+
"l1 button": 4,
|
17
|
+
"r1 button": 5,
|
18
|
+
"cross button": 0,
|
19
|
+
"triangle button": 2,
|
20
|
+
"circle button": 1,
|
21
|
+
"square button": 3,
|
22
|
+
"left stick button": 11,
|
23
|
+
"right stick button": 12,
|
24
|
+
"logo button": 10,
|
25
|
+
"select button": 8,
|
26
|
+
"start button": 9,
|
27
|
+
"down button": 14,
|
28
|
+
"up button": 13,
|
29
|
+
"left button": 15,
|
30
|
+
"right button": 16
|
31
|
+
}
|
32
|
+
print(f"{self.name} connected.")
|
33
|
+
|
34
|
+
def close(self):
|
35
|
+
self.device.quit()
|
36
|
+
|
37
|
+
def handle_input(self, event):
|
38
|
+
pass
|
39
|
+
|
40
|
+
def left(self):
|
41
|
+
pass
|
42
|
+
|
43
|
+
def right(self):
|
44
|
+
pass
|
45
|
+
|
46
|
+
def up(self):
|
47
|
+
pass
|
48
|
+
|
49
|
+
def down(self):
|
50
|
+
pass
|
51
|
+
|
52
|
+
def pause(self):
|
53
|
+
pass
|
54
|
+
|
55
|
+
def rumble(self, left, right, duration=0):
|
56
|
+
if not left in range(256) or not right in range(256):
|
57
|
+
raise ValueError("left and right values must be in the range 0 - 255")
|
58
|
+
self.device.rumble(left / 255, right / 255, duration)
|
59
|
+
|
60
|
+
def stop_rumble(self):
|
61
|
+
self.device.stop_rumble()
|
62
|
+
|
63
|
+
@property
|
64
|
+
def name(self) -> str:
|
65
|
+
return self._name
|
66
|
+
|
67
|
+
@name.setter
|
68
|
+
def name(self, name: str) -> None:
|
69
|
+
self._name = name
|
70
|
+
|
@@ -6,6 +6,7 @@ pygameControls/controller.py
|
|
6
6
|
pygameControls/controlsbase.py
|
7
7
|
pygameControls/dualsense_controller.py
|
8
8
|
pygameControls/dualsense_edge_controller.py
|
9
|
+
pygameControls/dualshock3_controller.py
|
9
10
|
pygameControls/generic_controller.py
|
10
11
|
pygameControls/logitech_dual_action_controller.py
|
11
12
|
pygameControls/logitech_f310_controller.py
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pygamecontrols-0.1.11 → pygamecontrols-0.1.12}/pygameControls/logitech_dual_action_controller.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pygamecontrols-0.1.11 → pygamecontrols-0.1.12}/pygameControls.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|