commit 326e00f5cf181ca299a20d7a7599d8401de3d2c2
Author: Simon Howard <fraggle@soulsphere.org>
AuthorDate: Fri Nov 28 15:39:38 2014 -0500
Commit: Simon Howard <fraggle@soulsphere.org>
CommitDate: Fri Nov 28 15:39:38 2014 -0500
Update SDL_Keysym symbols to SDL2 constants.
SDL_keysym has changed to SDLK_Keysym, and some of the SDLK_ constants
have changed names to be more consistent.
---
src/i_video.c | 26 +++++++++++++-------------
textscreen/txt_sdl.c | 28 ++++++++++++++--------------
2 files changed, 27 insertions(+), 27 deletions(-)
diff --git a/src/i_video.c b/src/i_video.c
index 76ad23af..51e86273 100644
--- a/src/i_video.c
+++ b/src/i_video.c
@@ -449,7 +449,7 @@ void I_EnableLoadingDisk(void)
// Translates the SDL key
//
-static int TranslateKey(SDL_keysym *sym)
+static int TranslateKey(SDL_Keysym *sym)
{
switch(sym->sym)
{
@@ -472,7 +472,7 @@ static int TranslateKey(SDL_keysym *sym)
case SDLK_F10: return KEY_F10;
case SDLK_F11: return KEY_F11;
case SDLK_F12: return KEY_F12;
- case SDLK_PRINT: return KEY_PRTSCR;
+ case SDLK_PRINTSCREEN: return KEY_PRTSCR;
case SDLK_BACKSPACE: return KEY_BACKSPACE;
case SDLK_DELETE: return KEY_DEL;
@@ -502,19 +502,19 @@ static int TranslateKey(SDL_keysym *sym)
return KEY_RALT;
case SDLK_CAPSLOCK: return KEY_CAPSLOCK;
- case SDLK_SCROLLOCK: return KEY_SCRLCK;
+ case SDLK_SCROLLLOCK: return KEY_SCRLCK;
case SDLK_NUMLOCK: return KEY_NUMLOCK;
- case SDLK_KP0: return KEYP_0;
- case SDLK_KP1: return KEYP_1;
- case SDLK_KP2: return KEYP_2;
- case SDLK_KP3: return KEYP_3;
- case SDLK_KP4: return KEYP_4;
- case SDLK_KP5: return KEYP_5;
- case SDLK_KP6: return KEYP_6;
- case SDLK_KP7: return KEYP_7;
- case SDLK_KP8: return KEYP_8;
- case SDLK_KP9: return KEYP_9;
+ case SDLK_KP_0: return KEYP_0;
+ case SDLK_KP_1: return KEYP_1;
+ case SDLK_KP_2: return KEYP_2;
+ case SDLK_KP_3: return KEYP_3;
+ case SDLK_KP_4: return KEYP_4;
+ case SDLK_KP_5: return KEYP_5;
+ case SDLK_KP_6: return KEYP_6;
+ case SDLK_KP_7: return KEYP_7;
+ case SDLK_KP_8: return KEYP_8;
+ case SDLK_KP_9: return KEYP_9;
case SDLK_KP_PERIOD: return KEYP_PERIOD;
case SDLK_KP_MULTIPLY: return KEYP_MULTIPLY;
diff --git a/textscreen/txt_sdl.c b/textscreen/txt_sdl.c
index 5576a151..0a5bc17a 100644
--- a/textscreen/txt_sdl.c
+++ b/textscreen/txt_sdl.c
@@ -426,7 +426,7 @@ void TXT_GetMousePosition(int *x, int *y)
// Translates the SDL key
//
-static int TranslateKey(SDL_keysym *sym)
+static int TranslateKey(SDL_Keysym *sym)
{
switch(sym->sym)
{
@@ -449,7 +449,7 @@ static int TranslateKey(SDL_keysym *sym)
case SDLK_F10: return KEY_F10;
case SDLK_F11: return KEY_F11;
case SDLK_F12: return KEY_F12;
- case SDLK_PRINT: return KEY_PRTSCR;
+ case SDLK_PRINTSCREEN: return KEY_PRTSCR;
case SDLK_BACKSPACE: return KEY_BACKSPACE;
case SDLK_DELETE: return KEY_DEL;
@@ -473,7 +473,7 @@ static int TranslateKey(SDL_keysym *sym)
return KEY_RALT;
case SDLK_CAPSLOCK: return KEY_CAPSLOCK;
- case SDLK_SCROLLOCK: return KEY_SCRLCK;
+ case SDLK_SCROLLLOCK: return KEY_SCRLCK;
case SDLK_HOME: return KEY_HOME;
case SDLK_INSERT: return KEY_INS;
@@ -521,16 +521,16 @@ static int TranslateKey(SDL_keysym *sym)
switch (sym->sym)
{
- case SDLK_KP0: return KEYP_0;
- case SDLK_KP1: return KEYP_1;
- case SDLK_KP2: return KEYP_2;
- case SDLK_KP3: return KEYP_3;
- case SDLK_KP4: return KEYP_4;
- case SDLK_KP5: return KEYP_5;
- case SDLK_KP6: return KEYP_6;
- case SDLK_KP7: return KEYP_7;
- case SDLK_KP8: return KEYP_8;
- case SDLK_KP9: return KEYP_9;
+ case SDLK_KP_0: return KEYP_0;
+ case SDLK_KP_1: return KEYP_1;
+ case SDLK_KP_2: return KEYP_2;
+ case SDLK_KP_3: return KEYP_3;
+ case SDLK_KP_4: return KEYP_4;
+ case SDLK_KP_5: return KEYP_5;
+ case SDLK_KP_6: return KEYP_6;
+ case SDLK_KP_7: return KEYP_7;
+ case SDLK_KP_8: return KEYP_8;
+ case SDLK_KP_9: return KEYP_9;
case SDLK_KP_PERIOD: return KEYP_PERIOD;
case SDLK_KP_MULTIPLY: return KEYP_MULTIPLY;
@@ -586,7 +586,7 @@ static int MouseHasMoved(void)
// Examine a key press/release and update the modifier key state
// if necessary.
-static void UpdateModifierState(SDL_keysym *sym, int pressed)
+static void UpdateModifierState(SDL_Keysym *sym, int pressed)
{
txt_modifier_t mod;