diff --git a/src/gui/console/ConsoleView.cpp b/src/gui/console/ConsoleView.cpp index 383e0cb32..99dc65953 100644 --- a/src/gui/console/ConsoleView.cpp +++ b/src/gui/console/ConsoleView.cpp @@ -41,10 +41,10 @@ void ConsoleView::DoKeyPress(int key, Uint16 character, bool shift, bool ctrl, b commandField->SetText(""); commandField->SetDisplayText(""); break; - case KEY_DOWN: + case KEY_DOWN: case KEY_NUM_DOWN: c->NextCommand(); break; - case KEY_UP: + case KEY_UP: case KEY_NUM_UP: c->PreviousCommand(); break; default: diff --git a/src/gui/game/PropertyTool.cpp b/src/gui/game/PropertyTool.cpp index 72d085750..3e734ceaa 100644 --- a/src/gui/game/PropertyTool.cpp +++ b/src/gui/game/PropertyTool.cpp @@ -229,9 +229,9 @@ void PropertyWindow::OnDraw() void PropertyWindow::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt) { - if (key == KEY_UP) + if (key == KEY_UP || key == KEY_NUM_UP) property->SetOption(property->GetOption().second-1); - else if (key == KEY_DOWN) + else if (key == KEY_DOWN || key == KEY_NUM_DOWN) property->SetOption(property->GetOption().second+1); } diff --git a/src/gui/interface/Keys.h b/src/gui/interface/Keys.h index fcc956906..351e96e65 100644 --- a/src/gui/interface/Keys.h +++ b/src/gui/interface/Keys.h @@ -2,11 +2,17 @@ #if defined(USE_SDL) #include "SDL.h" #define KEY_UP SDLK_UP +#define KEY_NUM_UP SDLK_KP8 #define KEY_DOWN SDLK_DOWN +#define KEY_NUM_DOWN SDLK_KP2 #define KEY_RIGHT SDLK_RIGHT +#define KEY_NUM_RIGHT SDLK_KP6 #define KEY_LEFT SDLK_LEFT +#define KEY_NUM_LEFT SDLK_KP4 #define KEY_HOME SDLK_HOME +#define KEY_NUM_HOME SDLK_KP7 #define KEY_END SDLK_END +#define KEY_NUM_END SDLK_KP1 #define KEY_BACKSPACE SDLK_BACKSPACE #define KEY_DELETE SDLK_DELETE #define KEY_TAB SDLK_TAB @@ -57,11 +63,17 @@ #else #define KEY_UP 1 +#define KEY_NUM_UP 47 #define KEY_DOWN 2 +#define KEY_NUM_DOWN 48 #define KEY_RIGHT 3 +#define KEY_NUM_RIGHT 49 #define KEY_LEFT 4 +#define KEY_NUM_LEFT 50 #define KEY_HOME 5 +#define KEY_NUM_HOME 51 #define KEY_END 6 +#define KEY_NUM_END 47 #define KEY_BACKSPACE 7 #define KEY_DELETE 8 #define KEY_TAB 9 diff --git a/src/gui/interface/Textbox.cpp b/src/gui/interface/Textbox.cpp index 0e854064e..53c39fe42 100644 --- a/src/gui/interface/Textbox.cpp +++ b/src/gui/interface/Textbox.cpp @@ -342,20 +342,20 @@ void Textbox::OnVKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool { switch(key) { - case KEY_HOME: + case KEY_HOME: case KEY_NUM_HOME: cursor = 0; ClearSelection(); break; - case KEY_END: + case KEY_END: case KEY_NUM_END: cursor = backingText.length(); ClearSelection(); break; - case KEY_LEFT: + case KEY_LEFT: case KEY_NUM_LEFT: if(cursor > 0) cursor--; ClearSelection(); break; - case KEY_RIGHT: + case KEY_RIGHT: case KEY_NUM_RIGHT: if(cursor < backingText.length()) cursor++; ClearSelection();