pygameControls 0.1.10__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.10 → pygamecontrols-0.1.12}/PKG-INFO +1 -1
- {pygamecontrols-0.1.10 → pygamecontrols-0.1.12}/pygameControls/controller.py +4 -2
- {pygamecontrols-0.1.10 → pygamecontrols-0.1.12}/pygameControls/dualsense_controller.py +11 -19
- pygamecontrols-0.1.12/pygameControls/dualshock3_controller.py +70 -0
- {pygamecontrols-0.1.10 → pygamecontrols-0.1.12}/pygameControls/generic_controller.py +12 -18
- {pygamecontrols-0.1.10 → pygamecontrols-0.1.12}/pygameControls/logitech_dual_action_controller.py +12 -18
- {pygamecontrols-0.1.10 → pygamecontrols-0.1.12}/pygameControls/logitech_f310_controller.py +11 -19
- {pygamecontrols-0.1.10 → pygamecontrols-0.1.12}/pygameControls/logitech_f510_controller.py +11 -19
- {pygamecontrols-0.1.10 → pygamecontrols-0.1.12}/pygameControls/logitech_f710_controller.py +11 -19
- {pygamecontrols-0.1.10 → pygamecontrols-0.1.12}/pygameControls/xbox_series_x_controller.py +10 -18
- {pygamecontrols-0.1.10 → pygamecontrols-0.1.12}/pygameControls.egg-info/PKG-INFO +1 -1
- {pygamecontrols-0.1.10 → pygamecontrols-0.1.12}/pygameControls.egg-info/SOURCES.txt +1 -0
- {pygamecontrols-0.1.10 → pygamecontrols-0.1.12}/setup.py +1 -1
- {pygamecontrols-0.1.10 → pygamecontrols-0.1.12}/LICENSE +0 -0
- {pygamecontrols-0.1.10 → pygamecontrols-0.1.12}/README.md +0 -0
- {pygamecontrols-0.1.10 → pygamecontrols-0.1.12}/pygameControls/__init__.py +0 -0
- {pygamecontrols-0.1.10 → pygamecontrols-0.1.12}/pygameControls/controlsbase.py +0 -0
- {pygamecontrols-0.1.10 → pygamecontrols-0.1.12}/pygameControls/dualsense_edge_controller.py +0 -0
- {pygamecontrols-0.1.10 → pygamecontrols-0.1.12}/pygameControls.egg-info/dependency_links.txt +0 -0
- {pygamecontrols-0.1.10 → pygamecontrols-0.1.12}/pygameControls.egg-info/top_level.txt +0 -0
- {pygamecontrols-0.1.10 → 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:
|
@@ -25,25 +25,17 @@ class DualSenseController(ControlsBase):
|
|
25
25
|
self.numbuttons: int = joy.get_numbuttons()
|
26
26
|
self.buttons: list = [joy.get_button(b) for b in range(self.numbuttons)]
|
27
27
|
self.mapping = {
|
28
|
-
"
|
29
|
-
"
|
30
|
-
"
|
31
|
-
"
|
32
|
-
"
|
33
|
-
"
|
34
|
-
"
|
35
|
-
"
|
36
|
-
"
|
37
|
-
"
|
38
|
-
"
|
39
|
-
"triangle button": self.buttons[2],
|
40
|
-
"circle button": self.buttons[1],
|
41
|
-
"square button": self.buttons[3],
|
42
|
-
"left stick button": self.buttons[11],
|
43
|
-
"right stick button": self.buttons[12],
|
44
|
-
"connect button": self.buttons[8],
|
45
|
-
"list button": self.buttons[9],
|
46
|
-
"logo button": self.buttons[10]
|
28
|
+
"l1 button": 4,
|
29
|
+
"r1 button": 5,
|
30
|
+
"cross button": 0,
|
31
|
+
"triangle button": 2,
|
32
|
+
"circle button": 1,
|
33
|
+
"square button": 3,
|
34
|
+
"left stick button": 11,
|
35
|
+
"right stick button": 12,
|
36
|
+
"connect button": 8,
|
37
|
+
"list button": 9,
|
38
|
+
"logo button": 10
|
47
39
|
}
|
48
40
|
print(f"{self.name} connected")
|
49
41
|
print(f"Power level: {self.powerlevel}")
|
@@ -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
|
+
|
@@ -14,24 +14,18 @@ class GenericController(ControlsBase):
|
|
14
14
|
self.numbuttons: int = self.device.get_numbuttons()
|
15
15
|
self.buttons: list = [self.device.get_button(b) for b in range(self.numbuttons)]
|
16
16
|
self.mapping = {
|
17
|
-
"
|
18
|
-
"
|
19
|
-
"
|
20
|
-
"
|
21
|
-
"
|
22
|
-
"
|
23
|
-
"
|
24
|
-
"
|
25
|
-
"left button":
|
26
|
-
"right button":
|
27
|
-
"
|
28
|
-
"
|
29
|
-
"A button": self.buttons[1],
|
30
|
-
"B button": self.buttons[2],
|
31
|
-
"left stick button": self.buttons[10],
|
32
|
-
"right stick button": self.buttons[11],
|
33
|
-
"back button": self.buttons[8],
|
34
|
-
"start button": self.buttons[9],
|
17
|
+
"r2 trigger": 7,
|
18
|
+
"l2 trigger": 6,
|
19
|
+
"l1 button": 4,
|
20
|
+
"r1 button": 5,
|
21
|
+
"X button": 0,
|
22
|
+
"Y button": 3,
|
23
|
+
"A button": 1,
|
24
|
+
"B button": 2,
|
25
|
+
"left stick button": 10,
|
26
|
+
"right stick button": 11,
|
27
|
+
"back button": 8,
|
28
|
+
"start button": 9,
|
35
29
|
"logo button": None
|
36
30
|
}
|
37
31
|
print(f"{self.name} connected.")
|
{pygamecontrols-0.1.10 → pygamecontrols-0.1.12}/pygameControls/logitech_dual_action_controller.py
RENAMED
@@ -35,24 +35,18 @@ class LogitechDualActionController(ControlsBase):
|
|
35
35
|
self.buttons: list = [self.device.get_button(b) for b in range(self.numbuttons)]
|
36
36
|
self.input_mode = InputMode.DirectInput
|
37
37
|
self.mapping = {
|
38
|
-
"
|
39
|
-
"
|
40
|
-
"
|
41
|
-
"
|
42
|
-
"
|
43
|
-
"
|
44
|
-
"
|
45
|
-
"
|
46
|
-
"left button":
|
47
|
-
"right button":
|
48
|
-
"
|
49
|
-
"
|
50
|
-
"A button": self.buttons[1],
|
51
|
-
"B button": self.buttons[2],
|
52
|
-
"left stick button": self.buttons[10],
|
53
|
-
"right stick button": self.buttons[11],
|
54
|
-
"back button": self.buttons[8],
|
55
|
-
"start button": self.buttons[9],
|
38
|
+
"r2 trigger": 7,
|
39
|
+
"l2 trigger": 6,
|
40
|
+
"l1 button": 4,
|
41
|
+
"r1 button": 5,
|
42
|
+
"X button": 0,
|
43
|
+
"Y button": 3,
|
44
|
+
"A button": 1,
|
45
|
+
"B button": 2,
|
46
|
+
"left stick button": 10,
|
47
|
+
"right stick button": 11,
|
48
|
+
"back button": 8,
|
49
|
+
"start button": 9,
|
56
50
|
"logo button": None
|
57
51
|
}
|
58
52
|
print(f"{self.name} connected.")
|
@@ -35,25 +35,17 @@ class LogitechF310Controller(ControlsBase):
|
|
35
35
|
self.buttons: list = [self.device.get_button(b) for b in range(self.numbuttons)]
|
36
36
|
self.input_mode = InputMode.XInput
|
37
37
|
self.mapping = {
|
38
|
-
"
|
39
|
-
"
|
40
|
-
"
|
41
|
-
"
|
42
|
-
"
|
43
|
-
"
|
44
|
-
"
|
45
|
-
"
|
46
|
-
"
|
47
|
-
"
|
48
|
-
"
|
49
|
-
"Y button": self.buttons[3],
|
50
|
-
"A button": self.buttons[0],
|
51
|
-
"B button": self.buttons[1],
|
52
|
-
"left stick button": self.buttons[9],
|
53
|
-
"right stick button": self.buttons[10],
|
54
|
-
"back button": self.buttons[6],
|
55
|
-
"start button": self.buttons[7],
|
56
|
-
"logo button": self.buttons[8]
|
38
|
+
"l1 button": 4,
|
39
|
+
"r1 button": 5,
|
40
|
+
"X button": 2,
|
41
|
+
"Y button": 3,
|
42
|
+
"A button": 0,
|
43
|
+
"B button": 1,
|
44
|
+
"left stick button": 9,
|
45
|
+
"right stick button": 10,
|
46
|
+
"back button": 6,
|
47
|
+
"start button": 7,
|
48
|
+
"logo button": 8
|
57
49
|
}
|
58
50
|
print(f"{self.name} connected.")
|
59
51
|
|
@@ -37,25 +37,17 @@ class LogitechF510Controller(ControlsBase):
|
|
37
37
|
self.buttons: list = []
|
38
38
|
self.input_mode: InputMode.DirectInput
|
39
39
|
self.mapping = {
|
40
|
-
"
|
41
|
-
"
|
42
|
-
"
|
43
|
-
"
|
44
|
-
"
|
45
|
-
"
|
46
|
-
"
|
47
|
-
"
|
48
|
-
"
|
49
|
-
"
|
50
|
-
"
|
51
|
-
"Y button": self.buttons[3],
|
52
|
-
"A button": self.buttons[0],
|
53
|
-
"B button": self.buttons[1],
|
54
|
-
"left stick button": self.buttons[9],
|
55
|
-
"right stick button": self.buttons[10],
|
56
|
-
"back button": self.buttons[6],
|
57
|
-
"start button": self.buttons[7],
|
58
|
-
"logo button": self.buttons[8]
|
40
|
+
"l1 button": 4,
|
41
|
+
"r1 button": 5,
|
42
|
+
"X button": 2,
|
43
|
+
"Y button": 3,
|
44
|
+
"A button": 0,
|
45
|
+
"B button": 1,
|
46
|
+
"left stick button": 9,
|
47
|
+
"right stick button": 10,
|
48
|
+
"back button": 6,
|
49
|
+
"start button": 7,
|
50
|
+
"logo button": 8
|
59
51
|
}
|
60
52
|
print(f"{self.name} connected.")
|
61
53
|
|
@@ -37,25 +37,17 @@ class LogitechF710Controller(ControlsBase):
|
|
37
37
|
self.buttons: list = []
|
38
38
|
self.input_mode: InputMode.DirectInput
|
39
39
|
self.mapping = {
|
40
|
-
"
|
41
|
-
"
|
42
|
-
"
|
43
|
-
"
|
44
|
-
"
|
45
|
-
"
|
46
|
-
"
|
47
|
-
"
|
48
|
-
"
|
49
|
-
"
|
50
|
-
"
|
51
|
-
"Y button": self.buttons[3],
|
52
|
-
"A button": self.buttons[0],
|
53
|
-
"B button": self.buttons[1],
|
54
|
-
"left stick button": self.buttons[9],
|
55
|
-
"right stick button": self.buttons[10],
|
56
|
-
"back button": self.buttons[6],
|
57
|
-
"start button": self.buttons[7],
|
58
|
-
"logo button": self.buttons[8]
|
40
|
+
"l1 button": 4,
|
41
|
+
"r1 button": 5,
|
42
|
+
"X button": 2,
|
43
|
+
"Y button": 3,
|
44
|
+
"A button": 0,
|
45
|
+
"B button": 1,
|
46
|
+
"left stick button": 9,
|
47
|
+
"right stick button": 10,
|
48
|
+
"back button": 6,
|
49
|
+
"start button": 7,
|
50
|
+
"logo button": 8
|
59
51
|
}
|
60
52
|
print(f"{self.name} connected.")
|
61
53
|
|
@@ -13,26 +13,18 @@ class XboxSeriesXController(ControlsBase):
|
|
13
13
|
self.numbuttons: int = self.device.get_numbuttons()
|
14
14
|
self.buttons: list = [self.device.get_button(b) for b in range(self.numbuttons)]
|
15
15
|
self.mapping = {
|
16
|
-
"
|
17
|
-
"
|
18
|
-
"
|
19
|
-
"right stick y": self.axis[3],
|
20
|
-
"right trigger": self.axis[4],
|
21
|
-
"left trigger": self.axis[5],
|
22
|
-
"dhat x": self.hats[0][0],
|
23
|
-
"dhat y": self.hats[0][1],
|
24
|
-
"left button": self.buttons[6],
|
25
|
-
"right button": self.buttons[7],
|
26
|
-
"X button": self.buttons[3],
|
16
|
+
"l1 button": 6,
|
17
|
+
"r1 button": 7,
|
18
|
+
"X button": 3,
|
27
19
|
"Y button": 4,
|
28
20
|
"A button": 0,
|
29
|
-
"B button":
|
30
|
-
"left stick button":
|
31
|
-
"right stick button":
|
32
|
-
"logo button":
|
33
|
-
"share button":
|
34
|
-
"list button":
|
35
|
-
"copy button":
|
21
|
+
"B button": 1,
|
22
|
+
"left stick button": 13,
|
23
|
+
"right stick button": 14,
|
24
|
+
"logo button": 12,
|
25
|
+
"share button": 15,
|
26
|
+
"list button": 11,
|
27
|
+
"copy button": 10
|
36
28
|
}
|
37
29
|
print(f"{self.name} connected.")
|
38
30
|
|
@@ -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
|
{pygamecontrols-0.1.10 → pygamecontrols-0.1.12}/pygameControls.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|