@@ -1060,9 +1060,9 @@ def __init__(self, type: str, which: int, axis: tcod.sdl.joystick.ControllerAxis
1060
1060
def from_sdl_event (cls , sdl_event : Any ) -> ControllerAxis :
1061
1061
return cls (
1062
1062
"CONTROLLERAXISMOTION" ,
1063
- sdl_event .caxis .which ,
1064
- tcod .sdl .joystick .ControllerAxis (sdl_event .caxis .axis ),
1065
- sdl_event .caxis .value ,
1063
+ sdl_event .gaxis .which ,
1064
+ tcod .sdl .joystick .ControllerAxis (sdl_event .gaxis .axis ),
1065
+ sdl_event .gaxis .value ,
1066
1066
)
1067
1067
1068
1068
def __repr__ (self ) -> str :
@@ -1099,9 +1099,9 @@ def from_sdl_event(cls, sdl_event: Any) -> ControllerButton:
1099
1099
}[sdl_event .type ]
1100
1100
return cls (
1101
1101
type ,
1102
- sdl_event .cbutton .which ,
1103
- tcod .sdl .joystick .ControllerButton (sdl_event .cbutton .button ),
1104
- bool (sdl_event .cbutton .down ),
1102
+ sdl_event .gbutton .which ,
1103
+ tcod .sdl .joystick .ControllerButton (sdl_event .gbutton .button ),
1104
+ bool (sdl_event .gbutton .down ),
1105
1105
)
1106
1106
1107
1107
def __repr__ (self ) -> str :
@@ -1130,7 +1130,7 @@ def from_sdl_event(cls, sdl_event: Any) -> ControllerDevice:
1130
1130
lib .SDL_EVENT_GAMEPAD_REMOVED : "CONTROLLERDEVICEREMOVED" ,
1131
1131
lib .SDL_EVENT_GAMEPAD_REMAPPED : "CONTROLLERDEVICEREMAPPED" ,
1132
1132
}[sdl_event .type ]
1133
- return cls (type , sdl_event .cdevice .which )
1133
+ return cls (type , sdl_event .gdevice .which )
1134
1134
1135
1135
1136
1136
@functools .cache
0 commit comments