map numpad keys to movement keys where applicable
This commit is contained in:
parent
5b886fc51e
commit
250b522221
@ -41,10 +41,10 @@ void ConsoleView::DoKeyPress(int key, Uint16 character, bool shift, bool ctrl, b
|
|||||||
commandField->SetText("");
|
commandField->SetText("");
|
||||||
commandField->SetDisplayText("");
|
commandField->SetDisplayText("");
|
||||||
break;
|
break;
|
||||||
case KEY_DOWN:
|
case KEY_DOWN: case KEY_NUM_DOWN:
|
||||||
c->NextCommand();
|
c->NextCommand();
|
||||||
break;
|
break;
|
||||||
case KEY_UP:
|
case KEY_UP: case KEY_NUM_UP:
|
||||||
c->PreviousCommand();
|
c->PreviousCommand();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -229,9 +229,9 @@ void PropertyWindow::OnDraw()
|
|||||||
|
|
||||||
void PropertyWindow::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool alt)
|
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);
|
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);
|
property->SetOption(property->GetOption().second+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,11 +2,17 @@
|
|||||||
#if defined(USE_SDL)
|
#if defined(USE_SDL)
|
||||||
#include "SDL.h"
|
#include "SDL.h"
|
||||||
#define KEY_UP SDLK_UP
|
#define KEY_UP SDLK_UP
|
||||||
|
#define KEY_NUM_UP SDLK_KP8
|
||||||
#define KEY_DOWN SDLK_DOWN
|
#define KEY_DOWN SDLK_DOWN
|
||||||
|
#define KEY_NUM_DOWN SDLK_KP2
|
||||||
#define KEY_RIGHT SDLK_RIGHT
|
#define KEY_RIGHT SDLK_RIGHT
|
||||||
|
#define KEY_NUM_RIGHT SDLK_KP6
|
||||||
#define KEY_LEFT SDLK_LEFT
|
#define KEY_LEFT SDLK_LEFT
|
||||||
|
#define KEY_NUM_LEFT SDLK_KP4
|
||||||
#define KEY_HOME SDLK_HOME
|
#define KEY_HOME SDLK_HOME
|
||||||
|
#define KEY_NUM_HOME SDLK_KP7
|
||||||
#define KEY_END SDLK_END
|
#define KEY_END SDLK_END
|
||||||
|
#define KEY_NUM_END SDLK_KP1
|
||||||
#define KEY_BACKSPACE SDLK_BACKSPACE
|
#define KEY_BACKSPACE SDLK_BACKSPACE
|
||||||
#define KEY_DELETE SDLK_DELETE
|
#define KEY_DELETE SDLK_DELETE
|
||||||
#define KEY_TAB SDLK_TAB
|
#define KEY_TAB SDLK_TAB
|
||||||
@ -57,11 +63,17 @@
|
|||||||
#else
|
#else
|
||||||
|
|
||||||
#define KEY_UP 1
|
#define KEY_UP 1
|
||||||
|
#define KEY_NUM_UP 47
|
||||||
#define KEY_DOWN 2
|
#define KEY_DOWN 2
|
||||||
|
#define KEY_NUM_DOWN 48
|
||||||
#define KEY_RIGHT 3
|
#define KEY_RIGHT 3
|
||||||
|
#define KEY_NUM_RIGHT 49
|
||||||
#define KEY_LEFT 4
|
#define KEY_LEFT 4
|
||||||
|
#define KEY_NUM_LEFT 50
|
||||||
#define KEY_HOME 5
|
#define KEY_HOME 5
|
||||||
|
#define KEY_NUM_HOME 51
|
||||||
#define KEY_END 6
|
#define KEY_END 6
|
||||||
|
#define KEY_NUM_END 47
|
||||||
#define KEY_BACKSPACE 7
|
#define KEY_BACKSPACE 7
|
||||||
#define KEY_DELETE 8
|
#define KEY_DELETE 8
|
||||||
#define KEY_TAB 9
|
#define KEY_TAB 9
|
||||||
|
@ -342,20 +342,20 @@ void Textbox::OnVKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool
|
|||||||
{
|
{
|
||||||
switch(key)
|
switch(key)
|
||||||
{
|
{
|
||||||
case KEY_HOME:
|
case KEY_HOME: case KEY_NUM_HOME:
|
||||||
cursor = 0;
|
cursor = 0;
|
||||||
ClearSelection();
|
ClearSelection();
|
||||||
break;
|
break;
|
||||||
case KEY_END:
|
case KEY_END: case KEY_NUM_END:
|
||||||
cursor = backingText.length();
|
cursor = backingText.length();
|
||||||
ClearSelection();
|
ClearSelection();
|
||||||
break;
|
break;
|
||||||
case KEY_LEFT:
|
case KEY_LEFT: case KEY_NUM_LEFT:
|
||||||
if(cursor > 0)
|
if(cursor > 0)
|
||||||
cursor--;
|
cursor--;
|
||||||
ClearSelection();
|
ClearSelection();
|
||||||
break;
|
break;
|
||||||
case KEY_RIGHT:
|
case KEY_RIGHT: case KEY_NUM_RIGHT:
|
||||||
if(cursor < backingText.length())
|
if(cursor < backingText.length())
|
||||||
cursor++;
|
cursor++;
|
||||||
ClearSelection();
|
ClearSelection();
|
||||||
|
Loading…
Reference in New Issue
Block a user