Open Dev5H0 opened 2 years ago
I'm not familiar enough with this library to want to make a pull request (and I know this thread is old), but this works for me
class SwitchPro(Gamepad.Gamepad):
fullName = "Nintendo Switch Pro Controller"
def __init__(self, joystickNumber=0):
Gamepad.Gamepad.__init__(self, joystickNumber)
self.axisNames = {
# Joysticks
1: "LSV", # Left Stick Vertical
0: "LSH", # eft Stick Horizontal
3: "RSV", # Right Stick Vertical
2: "RSH", # Right Stick Horizontal
# D pad
5: "DV", # D-Pad Vertical
4: "DH", # D-Pad Horizontal
}
self.buttonNames = {
# faces
0: "B",
1: "A",
2: "X",
3: "Y",
# menuing
10: "Plus",
9: "Minus",
# joysticks
12: "Left Stick Button",
13: "Right Stick Button",
# special
11: "Home",
4: "Screenshot",
# bumpers / triggers
5: "LB",
6: "RB",
7: "LT",
8: "RT",
}
self._setupReverseMaps()