Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 311b047bf5 | |||
| 13901aeb50 | |||
| 5f3f25cc8c | |||
| 96ae8860d5 |
@@ -3,4 +3,4 @@
|
||||
Small module to make it easy to add controller support.
|
||||
|
||||

|
||||

|
||||

|
||||
1
main.py
1
main.py
@@ -4,7 +4,6 @@ from pygameControls import globals
|
||||
|
||||
if __name__ == "__main__":
|
||||
pygame.init()
|
||||
globals.init()
|
||||
|
||||
done = False
|
||||
|
||||
|
||||
@@ -1,20 +1,18 @@
|
||||
import pygame
|
||||
from . import globals
|
||||
|
||||
__version__ = "0.2.3"
|
||||
__version__ = "0.2.5"
|
||||
|
||||
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"]
|
||||
|
||||
Reference in New Issue
Block a user