pygameControls 0.1.12__tar.gz → 0.1.13__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.
Files changed (22) hide show
  1. {pygamecontrols-0.1.12 → pygamecontrols-0.1.13}/PKG-INFO +1 -1
  2. {pygamecontrols-0.1.12 → pygamecontrols-0.1.13}/pygameControls/controller.py +5 -3
  3. pygamecontrols-0.1.12/pygameControls/dualshock3_controller.py → pygamecontrols-0.1.13/pygameControls/playstation3_controller.py +1 -1
  4. pygamecontrols-0.1.13/pygameControls/sony_playstation3_controller.py +70 -0
  5. {pygamecontrols-0.1.12 → pygamecontrols-0.1.13}/pygameControls.egg-info/PKG-INFO +1 -1
  6. {pygamecontrols-0.1.12 → pygamecontrols-0.1.13}/pygameControls.egg-info/SOURCES.txt +2 -1
  7. {pygamecontrols-0.1.12 → pygamecontrols-0.1.13}/setup.py +1 -1
  8. {pygamecontrols-0.1.12 → pygamecontrols-0.1.13}/LICENSE +0 -0
  9. {pygamecontrols-0.1.12 → pygamecontrols-0.1.13}/README.md +0 -0
  10. {pygamecontrols-0.1.12 → pygamecontrols-0.1.13}/pygameControls/__init__.py +0 -0
  11. {pygamecontrols-0.1.12 → pygamecontrols-0.1.13}/pygameControls/controlsbase.py +0 -0
  12. {pygamecontrols-0.1.12 → pygamecontrols-0.1.13}/pygameControls/dualsense_controller.py +0 -0
  13. {pygamecontrols-0.1.12 → pygamecontrols-0.1.13}/pygameControls/dualsense_edge_controller.py +0 -0
  14. {pygamecontrols-0.1.12 → pygamecontrols-0.1.13}/pygameControls/generic_controller.py +0 -0
  15. {pygamecontrols-0.1.12 → pygamecontrols-0.1.13}/pygameControls/logitech_dual_action_controller.py +0 -0
  16. {pygamecontrols-0.1.12 → pygamecontrols-0.1.13}/pygameControls/logitech_f310_controller.py +0 -0
  17. {pygamecontrols-0.1.12 → pygamecontrols-0.1.13}/pygameControls/logitech_f510_controller.py +0 -0
  18. {pygamecontrols-0.1.12 → pygamecontrols-0.1.13}/pygameControls/logitech_f710_controller.py +0 -0
  19. {pygamecontrols-0.1.12 → pygamecontrols-0.1.13}/pygameControls/xbox_series_x_controller.py +0 -0
  20. {pygamecontrols-0.1.12 → pygamecontrols-0.1.13}/pygameControls.egg-info/dependency_links.txt +0 -0
  21. {pygamecontrols-0.1.12 → pygamecontrols-0.1.13}/pygameControls.egg-info/top_level.txt +0 -0
  22. {pygamecontrols-0.1.12 → pygamecontrols-0.1.13}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pygameControls
3
- Version: 0.1.12
3
+ Version: 0.1.13
4
4
  Summary: A simple controller class for pygame.
5
5
  Home-page:
6
6
  Author: Jan Lerking
@@ -6,11 +6,12 @@ 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
+ from .sony_playstation3_controller import SonyPlayStation3Controller
10
+ from .playstation3_controller import PlayStation3Controller
10
11
  from .generic_controller import GenericController
11
12
  from .logitech_dual_action_controller import LogitechDualActionController
12
13
 
13
- __version__ = "0.1.12"
14
+ __version__ = "0.1.13"
14
15
 
15
16
  CONTROLLERS = {
16
17
  "DualSense Wireless Controller": DualSenseController,
@@ -20,7 +21,8 @@ CONTROLLERS = {
20
21
  "Logitech Gamepad F710": LogitechF710Controller,
21
22
  "Logitech Dual Action": LogitechDualActionController,
22
23
  "Xbox Series X Controller": XboxSeriesXController,
23
- "PLAYSTATION(R)3 Controller": DualShock3Controller
24
+ "Sony PLAYSTATION(R)3 Controller": SonyPlayStation3Controller,
25
+ "PLAYSTATION(R)3 Controller": PlayStation3Controller
24
26
  }
25
27
 
26
28
  class Controllers:
@@ -1,6 +1,6 @@
1
1
  from pygameControls.controlsbase import ControlsBase
2
2
 
3
- class DualShock3Controller(ControlsBase):
3
+ class PlayStation3Controller(ControlsBase):
4
4
  def __init__(self, joy):
5
5
  self.device = joy
6
6
  self.instance_id: int = self.device.get_instance_id()
@@ -0,0 +1,70 @@
1
+ from pygameControls.controlsbase import ControlsBase
2
+
3
+ class SonyPlayStation3Controller(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
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pygameControls
3
- Version: 0.1.12
3
+ Version: 0.1.13
4
4
  Summary: A simple controller class for pygame.
5
5
  Home-page:
6
6
  Author: Jan Lerking
@@ -6,12 +6,13 @@ 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
10
9
  pygameControls/generic_controller.py
11
10
  pygameControls/logitech_dual_action_controller.py
12
11
  pygameControls/logitech_f310_controller.py
13
12
  pygameControls/logitech_f510_controller.py
14
13
  pygameControls/logitech_f710_controller.py
14
+ pygameControls/playstation3_controller.py
15
+ pygameControls/sony_playstation3_controller.py
15
16
  pygameControls/xbox_series_x_controller.py
16
17
  pygameControls.egg-info/PKG-INFO
17
18
  pygameControls.egg-info/SOURCES.txt
@@ -3,7 +3,7 @@ if __name__ == "__main__":
3
3
 
4
4
  setup(
5
5
  name='pygameControls',
6
- version='0.1.12',
6
+ version='0.1.13',
7
7
  packages=find_packages(),
8
8
  install_requires=[],
9
9
  author='Jan Lerking',
File without changes