Update pygameControls/xbox_360_controller.py

This commit is contained in:
2025-05-05 11:29:44 +02:00
parent d2bf9a8a1e
commit 74f2665a2f

View File

@@ -1,5 +1,5 @@
from pygameControls.controlsbase import ControlsBase from pygameControls.controlsbase import ControlsBase
from enums import ConnectionType from enums import ConnectionType, InputType
import pygame import pygame
class Xbox360Controller(ControlsBase): class Xbox360Controller(ControlsBase):
@@ -9,6 +9,7 @@ class Xbox360Controller(ControlsBase):
self.name = self.device.get_name() self.name = self.device.get_name()
self.guid = self.device.get_guid() self.guid = self.device.get_guid()
self.connection_type = ConnectionType(connection_type.values()) self.connection_type = ConnectionType(connection_type.values())
self.input_type = InputType.XInput
self.numaxis: int = self.device.get_numaxes() self.numaxis: int = self.device.get_numaxes()
self.axis: list = [self.device.get_axis(a) for a in range(self.numaxis)] self.axis: list = [self.device.get_axis(a) for a in range(self.numaxis)]
self.numhats: int = self.device.get_numhats() self.numhats: int = self.device.get_numhats()