From d26316d273a8914200e200a3f027933fd44f8d67 Mon Sep 17 00:00:00 2001 From: Lerking Date: Mon, 5 May 2025 09:02:09 +0200 Subject: [PATCH] Update pygameControls/controller.py Added connection type to class init. /JL --- pygameControls/controller.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pygameControls/controller.py b/pygameControls/controller.py index 305585d..8530310 100644 --- a/pygameControls/controller.py +++ b/pygameControls/controller.py @@ -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()