Update pygameControls/controller.py

Added connection type to class init. /JL
This commit is contained in:
2025-05-05 09:02:09 +02:00
parent 2a9746d510
commit d26316d273

View File

@@ -30,11 +30,9 @@ class Controllers:
def __init__(self, joy):
self.controllers = []
if not joy.get_name() in CONTROLLERS:
self.get_connection_type(joy.get_name())
self.controllers.append(GenericController(joy))
self.controllers.append(GenericController(joy, self.get_connection_type(joy.get_name())))
else:
self.get_connection_type(joy.get_name())
self.controllers.append(CONTROLLERS[joy.get_name()](joy))
self.controllers.append(CONTROLLERS[joy.get_name()](joy, self.get_connection_type(joy.get_name())))
def get_connection_type(self, controller_name):
for path in list_devices()