Work on XInputController class and creation.
@@ -390,12 +390,12 @@ class XInputDevice(Device):
'dpleft': Button('dpleft'),
'dpright': Button('dpright'),
- 'leftx': AbsoluteAxis('leftx', -32768, 32768),
- 'lefty': AbsoluteAxis('lefty', -32768, 32768),
- 'rightx': AbsoluteAxis('rightx', -32768, 32768),
- 'righty': AbsoluteAxis('righty', -32768, 32768),
- 'lefttrigger': AbsoluteAxis('lefttrigger', 0, 255),
- 'righttrigger': AbsoluteAxis('righttrigger', 0, 255)
+ 'leftx': AbsoluteAxis('x', -32768, 32768, 'leftx'),
+ 'lefty': AbsoluteAxis('y', -32768, 32768, 'lefty'),
+ 'rightx': AbsoluteAxis('rx', -32768, 32768, 'rightx'),
+ 'righty': AbsoluteAxis('ry', -32768, 32768, 'righty'),
+ 'lefttrigger': AbsoluteAxis('z', 0, 255, 'lefttrigger'),
+ 'righttrigger': AbsoluteAxis('rz', 0, 255, 'righttrigger')
}
def get_controls(self):
@@ -520,5 +520,4 @@ def get_devices():
def get_controllers():
- # TODO: make Controller subclass
- return []
+ return [XInputController(device) for device in get_devices()]
