10 Commits
v0.2.2 ... main

Author SHA1 Message Date
0a3042b93c Merge pull request 'Added Logitech Rumblepad 2. /JL' (#30) from 0.2.7 into main
Reviewed-on: #30
2025-05-13 14:01:21 +02:00
73fecc1904 Added Logitech Rumblepad 2. /JL
Some checks failed
Run Controller Tests / test (push) Has been cancelled
2025-05-13 14:01:01 +02:00
ed252a6548 Merge pull request 'Added Logitech F710 gamepad. /JL' (#29) from 0.2.6 into main
Reviewed-on: #29
2025-05-13 13:57:42 +02:00
ad3214dd23 Added Logitech F710 gamepad. /JL
Some checks failed
Run Controller Tests / test (push) Has been cancelled
2025-05-13 13:57:10 +02:00
311b047bf5 Merge pull request 'Removed debuging prints. /JL' (#28) from 0.2.5 into main
Reviewed-on: #28
2025-05-07 21:46:57 +02:00
13901aeb50 Removed debuging prints. /JL
Some checks failed
Run Controller Tests / test (push) Has been cancelled
2025-05-07 21:44:07 +02:00
5f3f25cc8c Merge pull request 'Updated initialization code. /JL' (#27) from 0.2.4 into main
Reviewed-on: #27
2025-05-07 21:41:01 +02:00
96ae8860d5 Updated initialization code. /JL
Some checks failed
Run Controller Tests / test (push) Has been cancelled
2025-05-07 21:40:40 +02:00
8a8f6deb89 Merge pull request 'Updated DualShock4 support. /JL' (#26) from 0.2.3 into main
Reviewed-on: #26
2025-05-07 21:34:21 +02:00
79230bfef3 Updated DualShock4 support. /JL
Some checks failed
Run Controller Tests / test (push) Has been cancelled
2025-05-07 21:33:46 +02:00
6 changed files with 13 additions and 19 deletions

View File

@@ -3,4 +3,4 @@
Small module to make it easy to add controller support.
![Tests](https://gitpot-lerking.servehttp.com/api/v1/badges/CodingPirates/PyGame-Controller/workflows/test.yml)
![Version](https://img.shields.io/badge/version-0.2.2-blue)
![Version](https://img.shields.io/badge/version-0.2.5-blue)

View File

@@ -4,7 +4,6 @@ from pygameControls import globals
if __name__ == "__main__":
pygame.init()
globals.init()
done = False

View File

@@ -1,20 +1,18 @@
import pygame
from . import globals
__version__ = "0.2.2"
__version__ = "0.2.7"
class Controllers:
def __init__(self, joy):
globals.init()
self.controllers = []
cont = self.detect_controller(joy.get_guid())
print(cont)
self.controllers.append(cont(joy))
def detect_controller(self, guid):
for gp in globals.GAMEPADS:
print(gp)
for p in globals.GAMEPADS[gp]:
print(p)
if p["guid"] != guid:
continue
return p["class"]

View File

@@ -126,10 +126,10 @@ def init():
},
{
"vidpid": "054c:09cc",
"guid": "",
"guid": "05009b514c050000cc09000000810000",
"connection": ConnectionType.BLUETOOTH,
"input": InputType.DirectInput,
"name": ["DualShock 4 v2 Controller"],
"name": ["Wireless Controller"],
"class": CONTROLLERS["Sony PLAYSTATION(R)4 Controller"]
}
],
@@ -183,7 +183,7 @@ def init():
},
{
"vidpid": "046d:c21d",
"guid": "",
"guid": "0333443e6d0400001fc2000005030000",
"connection": ConnectionType.USB,
"input": InputType.XInput,
"name": [
@@ -194,14 +194,15 @@ def init():
},
{
"vidpid": "046d:c216",
"guid": "",
"guid": "03005d8e6d04000019c2000011010000",
"connection": ConnectionType.USB,
"input": InputType.DirectInput,
"name": [
"Logitech, Inc. F710 Gamepad [DirectInput Mode]",
"Logitech Dual Action"
"Logitech Dual Action",
"Logitech Cordless Rumblepad 2"
],
"class": CONTROLLERS["Logitech Dual Action"]
"class": CONTROLLERS["Logitech Rumblepad 2"]
}
]
}

View File

@@ -23,12 +23,8 @@ class SonyPlayStation4Controller(ControlsBase):
"left stick button": 11,
"right stick button": 12,
"logo button": 10,
"select button": 8,
"start button": 9,
"down button": 14,
"up button": 13,
"left button": 15,
"right button": 16
"share button": 8,
"options button": 9
}
print(f"{self.name} connected.")

View File

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