Browse Source

Use SDL character key constants.

cosmy 9 years ago
parent
commit
945c231fd2
2 changed files with 39 additions and 39 deletions
  1. 3 3
      Source/Urho3D/Input/Input.cpp
  2. 36 36
      Source/Urho3D/Input/InputEvents.h

+ 3 - 3
Source/Urho3D/Input/Input.cpp

@@ -69,7 +69,7 @@ int ConvertSDLKeyCode(int keySym, int scanCode)
     if (scanCode == SCANCODE_AC_BACK)
         return KEY_ESC;
     else
-        return SDL_toupper(keySym);
+        return SDL_tolower(keySym);
 }
 
 UIElement* TouchState::GetTouchedElement()
@@ -1288,12 +1288,12 @@ String Input::GetScancodeName(int scancode) const
 
 bool Input::GetKeyDown(int key) const
 {
-    return keyDown_.Contains(SDL_toupper(key));
+    return keyDown_.Contains(SDL_tolower(key));
 }
 
 bool Input::GetKeyPress(int key) const
 {
-    return keyPress_.Contains(SDL_toupper(key));
+    return keyPress_.Contains(SDL_tolower(key));
 }
 
 bool Input::GetScancodeDown(int scancode) const

+ 36 - 36
Source/Urho3D/Input/InputEvents.h

@@ -232,42 +232,42 @@ static const int QUAL_CTRL = 2;
 static const int QUAL_ALT = 4;
 static const int QUAL_ANY = 8;
 
-static const int KEY_A = 'A';
-static const int KEY_B = 'B';
-static const int KEY_C = 'C';
-static const int KEY_D = 'D';
-static const int KEY_E = 'E';
-static const int KEY_F = 'F';
-static const int KEY_G = 'G';
-static const int KEY_H = 'H';
-static const int KEY_I = 'I';
-static const int KEY_J = 'J';
-static const int KEY_K = 'K';
-static const int KEY_L = 'L';
-static const int KEY_M = 'M';
-static const int KEY_N = 'N';
-static const int KEY_O = 'O';
-static const int KEY_P = 'P';
-static const int KEY_Q = 'Q';
-static const int KEY_R = 'R';
-static const int KEY_S = 'S';
-static const int KEY_T = 'T';
-static const int KEY_U = 'U';
-static const int KEY_V = 'V';
-static const int KEY_W = 'W';
-static const int KEY_X = 'X';
-static const int KEY_Y = 'Y';
-static const int KEY_Z = 'Z';
-static const int KEY_0 = '0';
-static const int KEY_1 = '1';
-static const int KEY_2 = '2';
-static const int KEY_3 = '3';
-static const int KEY_4 = '4';
-static const int KEY_5 = '5';
-static const int KEY_6 = '6';
-static const int KEY_7 = '7';
-static const int KEY_8 = '8';
-static const int KEY_9 = '9';
+static const int KEY_A = SDLK_a;
+static const int KEY_B = SDLK_b;
+static const int KEY_C = SDLK_c;
+static const int KEY_D = SDLK_d;
+static const int KEY_E = SDLK_e;
+static const int KEY_F = SDLK_f;
+static const int KEY_G = SDLK_g;
+static const int KEY_H = SDLK_h;
+static const int KEY_I = SDLK_i;
+static const int KEY_J = SDLK_j;
+static const int KEY_K = SDLK_k;
+static const int KEY_L = SDLK_l;
+static const int KEY_M = SDLK_m;
+static const int KEY_N = SDLK_n;
+static const int KEY_O = SDLK_o;
+static const int KEY_P = SDLK_p;
+static const int KEY_Q = SDLK_q;
+static const int KEY_R = SDLK_r;
+static const int KEY_S = SDLK_s;
+static const int KEY_T = SDLK_t;
+static const int KEY_U = SDLK_u;
+static const int KEY_V = SDLK_v;
+static const int KEY_W = SDLK_w;
+static const int KEY_X = SDLK_x;
+static const int KEY_Y = SDLK_y;
+static const int KEY_Z = SDLK_z;
+static const int KEY_0 = SDLK_0;
+static const int KEY_1 = SDLK_1;
+static const int KEY_2 = SDLK_2;
+static const int KEY_3 = SDLK_3;
+static const int KEY_4 = SDLK_4;
+static const int KEY_5 = SDLK_5;
+static const int KEY_6 = SDLK_6;
+static const int KEY_7 = SDLK_7;
+static const int KEY_8 = SDLK_8;
+static const int KEY_9 = SDLK_9;
 static const int KEY_BACKSPACE = SDLK_BACKSPACE;
 static const int KEY_TAB = SDLK_TAB;
 static const int KEY_RETURN = SDLK_RETURN;