Add the raw platform specific key code to SDL_Keysym

This allows applications to handle keys that SDL doesn't recognize, in a platform dependent way.

Fixes https://github.com/libsdl-org/SDL/issues/6390
This commit is contained in:
Sam Lantinga
2024-06-18 18:34:55 -07:00
parent 9d816c72ef
commit ef9bd8b609
24 changed files with 163 additions and 139 deletions

View File

@@ -205,7 +205,7 @@ int Android_OnPadDown(int device_id, int keycode)
if (item && item->joystick) {
SDL_SendJoystickButton(timestamp, item->joystick, button, SDL_PRESSED);
} else {
SDL_SendKeyboardKey(timestamp, SDL_GLOBAL_KEYBOARD_ID, SDL_PRESSED, button_to_scancode(button));
SDL_SendKeyboardKey(timestamp, SDL_GLOBAL_KEYBOARD_ID, keycode, button_to_scancode(button), SDL_PRESSED);
}
SDL_UnlockJoysticks();
return 0;
@@ -225,7 +225,7 @@ int Android_OnPadUp(int device_id, int keycode)
if (item && item->joystick) {
SDL_SendJoystickButton(timestamp, item->joystick, button, SDL_RELEASED);
} else {
SDL_SendKeyboardKey(timestamp, SDL_GLOBAL_KEYBOARD_ID, SDL_RELEASED, button_to_scancode(button));
SDL_SendKeyboardKey(timestamp, SDL_GLOBAL_KEYBOARD_ID, keycode, button_to_scancode(button), SDL_RELEASED);
}
SDL_UnlockJoysticks();
return 0;