mirror of
https://github.com/encounter/SDL.git
synced 2025-12-14 07:36:09 +00:00
SWITCH: bitmask joystick buttons to fit HidControllerKeys
SWITCH: improve and comment test
This commit is contained in:
@@ -181,7 +181,8 @@ SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)
|
||||
for (int i = 0; i < sizeof(pad_mapping) / sizeof(*pad_mapping); i++) {
|
||||
if (changed & pad_mapping[i]) {
|
||||
SDL_PrivateJoystickButton(
|
||||
joystick, (Uint8) i, (Uint8) ((pad[index].buttons & pad_mapping[i]) ? SDL_PRESSED : SDL_RELEASED));
|
||||
joystick, (Uint8) BIT(i),
|
||||
(Uint8) ((pad[index].buttons & pad_mapping[i]) ? SDL_PRESSED : SDL_RELEASED));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user