shithub: choc

Download patch

ref: 326e00f5cf181ca299a20d7a7599d8401de3d2c2
parent: a1106c5d76b264446282feec3dea85b07d9cb2de
author: Simon Howard <[email protected]>
date: Fri Nov 28 10:39:38 EST 2014

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.

--- a/src/i_video.c
+++ b/src/i_video.c
@@ -449,7 +449,7 @@
 // Translates the SDL key
 //
 
-static int TranslateKey(SDL_keysym *sym)
+static int TranslateKey(SDL_Keysym *sym)
 {
     switch(sym->sym)
     {
@@ -472,7 +472,7 @@
       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 @@
         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;
--- a/textscreen/txt_sdl.c
+++ b/textscreen/txt_sdl.c
@@ -426,7 +426,7 @@
 // Translates the SDL key
 //
 
-static int TranslateKey(SDL_keysym *sym)
+static int TranslateKey(SDL_Keysym *sym)
 {
     switch(sym->sym)
     {
@@ -449,7 +449,7 @@
         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 @@
                                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 @@
 
         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 @@
 // 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;