Update pygameControls/logitech_f310_controller.py

This commit is contained in:
2025-05-05 09:24:46 +02:00
parent 8ac6883f17
commit b356ce2d9f

View File

@@ -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 LogitechF310Controller(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)]
@@ -49,6 +45,7 @@ class LogitechF310Controller(ControlsBase):
"logo button": 8
}
print(f"{self.name} connected.")
print(f"Connection type: {connection_type.capitalize()}")
def close(self):
pass