Update pygameControls/generic_controller.py
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import pygame
|
||||
from pygameControls.controlsbase import ControlsBase
|
||||
from enums import ConnectionType
|
||||
|
||||
class GenericController(ControlsBase):
|
||||
def __init__(self, joy, connection_type):
|
||||
@@ -7,7 +8,7 @@ class GenericController(ControlsBase):
|
||||
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.numaxis: int = self.device.get_numaxes()
|
||||
self.axis: list = [self.device.get_axis(a) for a in range(self.numaxis)]
|
||||
self.numhats: int = self.device.get_numhats()
|
||||
@@ -30,6 +31,7 @@ class GenericController(ControlsBase):
|
||||
"logo button": None
|
||||
}
|
||||
print(f"{self.name} connected.")
|
||||
print(f"Connection type: {connection_type.capitalize()}")
|
||||
|
||||
def close(self):
|
||||
pass
|
||||
|
Reference in New Issue
Block a user