Files
PyGame-Controller/pygameControls/controller.py
Jan Lerking ad3214dd23
Some checks failed
Run Controller Tests / test (push) Has been cancelled
Added Logitech F710 gamepad. /JL
2025-05-13 13:57:10 +02:00

19 lines
534 B
Python

import pygame
from . import globals
__version__ = "0.2.6"
class Controllers:
def __init__(self, joy):
globals.init()
self.controllers = []
cont = self.detect_controller(joy.get_guid())
self.controllers.append(cont(joy))
def detect_controller(self, guid):
for gp in globals.GAMEPADS:
for p in globals.GAMEPADS[gp]:
if p["guid"] != guid:
continue
return p["class"]
return globals.CONTROLLERS["Generic Controller"]