|
@@ -1676,9 +1676,9 @@ static void SDLTest_PrintEvent(const SDL_Event *event)
|
|
|
case SDL_EVENT_KEY_DOWN:
|
|
|
case SDL_EVENT_KEY_UP: {
|
|
|
char modstr[64];
|
|
|
- if (event->key.keysym.mod) {
|
|
|
+ if (event->key.mod) {
|
|
|
modstr[0] = '\0';
|
|
|
- SDLTest_PrintModState(modstr, sizeof (modstr), event->key.keysym.mod);
|
|
|
+ SDLTest_PrintModState(modstr, sizeof (modstr), event->key.mod);
|
|
|
} else {
|
|
|
SDL_strlcpy(modstr, "NONE", sizeof (modstr));
|
|
|
}
|
|
@@ -1686,9 +1686,9 @@ static void SDLTest_PrintEvent(const SDL_Event *event)
|
|
|
SDL_Log("SDL EVENT: Keyboard: key %s in window %" SDL_PRIu32 ": scancode 0x%08X = %s, keycode 0x%08" SDL_PRIX32 " = %s, mods = %s",
|
|
|
(event->type == SDL_EVENT_KEY_DOWN) ? "pressed" : "released",
|
|
|
event->key.windowID,
|
|
|
- event->key.keysym.scancode,
|
|
|
- SDL_GetScancodeName(event->key.keysym.scancode),
|
|
|
- event->key.keysym.sym, SDL_GetKeyName(event->key.keysym.sym),
|
|
|
+ event->key.scancode,
|
|
|
+ SDL_GetScancodeName(event->key.scancode),
|
|
|
+ event->key.key, SDL_GetKeyName(event->key.key),
|
|
|
modstr);
|
|
|
break;
|
|
|
}
|
|
@@ -2097,11 +2097,11 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event
|
|
|
break;
|
|
|
case SDL_EVENT_KEY_DOWN:
|
|
|
{
|
|
|
- SDL_bool withControl = !!(event->key.keysym.mod & SDL_KMOD_CTRL);
|
|
|
- SDL_bool withShift = !!(event->key.keysym.mod & SDL_KMOD_SHIFT);
|
|
|
- SDL_bool withAlt = !!(event->key.keysym.mod & SDL_KMOD_ALT);
|
|
|
+ SDL_bool withControl = !!(event->key.mod & SDL_KMOD_CTRL);
|
|
|
+ SDL_bool withShift = !!(event->key.mod & SDL_KMOD_SHIFT);
|
|
|
+ SDL_bool withAlt = !!(event->key.mod & SDL_KMOD_ALT);
|
|
|
|
|
|
- switch (event->key.keysym.sym) {
|
|
|
+ switch (event->key.key) {
|
|
|
/* Add hotkeys here */
|
|
|
case SDLK_PRINTSCREEN:
|
|
|
{
|
|
@@ -2158,7 +2158,7 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event
|
|
|
}
|
|
|
if (current_index >= 0) {
|
|
|
SDL_DisplayID dest;
|
|
|
- if (event->key.keysym.sym == SDLK_UP || event->key.keysym.sym == SDLK_LEFT) {
|
|
|
+ if (event->key.key == SDLK_UP || event->key.key == SDLK_LEFT) {
|
|
|
dest = displays[(current_index + num_displays - 1) % num_displays];
|
|
|
} else {
|
|
|
dest = displays[(current_index + num_displays + 1) % num_displays];
|
|
@@ -2180,16 +2180,16 @@ int SDLTest_CommonEventMainCallbacks(SDLTest_CommonState *state, const SDL_Event
|
|
|
int x, y;
|
|
|
SDL_GetWindowPosition(window, &x, &y);
|
|
|
|
|
|
- if (event->key.keysym.sym == SDLK_UP) {
|
|
|
+ if (event->key.key == SDLK_UP) {
|
|
|
y -= delta;
|
|
|
}
|
|
|
- if (event->key.keysym.sym == SDLK_DOWN) {
|
|
|
+ if (event->key.key == SDLK_DOWN) {
|
|
|
y += delta;
|
|
|
}
|
|
|
- if (event->key.keysym.sym == SDLK_LEFT) {
|
|
|
+ if (event->key.key == SDLK_LEFT) {
|
|
|
x -= delta;
|
|
|
}
|
|
|
- if (event->key.keysym.sym == SDLK_RIGHT) {
|
|
|
+ if (event->key.key == SDLK_RIGHT) {
|
|
|
x += delta;
|
|
|
}
|
|
|
|