From 8ac6883f17afaba70c98fdd5b30ba1f0b48fdcc4 Mon Sep 17 00:00:00 2001 From: Lerking Date: Mon, 5 May 2025 09:23:59 +0200 Subject: [PATCH] Update pygameControls/logitech_dual_action_controller.py --- pygameControls/logitech_dual_action_controller.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/pygameControls/logitech_dual_action_controller.py b/pygameControls/logitech_dual_action_controller.py index be3f64d..597b82d 100644 --- a/pygameControls/logitech_dual_action_controller.py +++ b/pygameControls/logitech_dual_action_controller.py @@ -14,19 +14,15 @@ This controller is a usb controller, with the following features. import pygame from pygameControls.controlsbase import ControlsBase -from enum import Enum +from enums import ConnectionType -class InputMode(Enum): - DirectInput = 1 - XInput = 2 - class LogitechDualActionController(ControlsBase): def __init__(self, joy, connection_type): self.device = joy self.instance_id: int = self.device.get_instance_id() self.name = self.device.get_name() self.guid = self.device.get_guid() - self.connection_type = connection_type + self.connection_type = ConnectionType(connection_type.values()) self.powerlevel = self.device.get_power_level() self.numaxis: int = self.device.get_numaxes() self.axis: list = [self.device.get_axis(a) for a in range(self.numaxis)] @@ -34,7 +30,6 @@ class LogitechDualActionController(ControlsBase): self.hats: list = [self.device.get_hat(h) for h in range(self.numhats)] self.numbuttons: int = self.device.get_numbuttons() self.buttons: list = [self.device.get_button(b) for b in range(self.numbuttons)] - self.input_mode = InputMode.DirectInput self.mapping = { "r2 trigger": 7, "l2 trigger": 6, @@ -51,6 +46,7 @@ class LogitechDualActionController(ControlsBase): "logo button": None } print(f"{self.name} connected.") + print(f"Connection type: {connection_type.capitalize()}") def close(self): pass