From 67c82ee283b81c32c77fd663819987df68097717 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Tue, 29 Oct 2013 20:51:44 +0000 Subject: [PATCH] Quick fix: Fix dummy key defs used by renderer and other non-input builds --- src/gui/game/GameView.cpp | 4 ++-- src/gui/interface/Keys.h | 33 ++++++++++++++++++++++++++------- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/src/gui/game/GameView.cpp b/src/gui/game/GameView.cpp index 4f434acb1..3dc677b8e 100644 --- a/src/gui/game/GameView.cpp +++ b/src/gui/game/GameView.cpp @@ -1487,10 +1487,10 @@ void GameView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool break; } //fancy case switch without break - case SDLK_INSERT: + case KEY_INSERT: c->SetReplaceModeFlags(c->GetReplaceModeFlags()^REPLACE_MODE); break; - case SDLK_DELETE: + case KEY_DELETE: c->SetReplaceModeFlags(c->GetReplaceModeFlags()^SPECIFIC_DELETE); break; } diff --git a/src/gui/interface/Keys.h b/src/gui/interface/Keys.h index b74042f34..fcc956906 100644 --- a/src/gui/interface/Keys.h +++ b/src/gui/interface/Keys.h @@ -13,6 +13,7 @@ #define KEY_RETURN SDLK_RETURN #define KEY_ENTER SDLK_KP_ENTER #define KEY_ESCAPE SDLK_ESCAPE +#define KEY_INSERT SDLK_INSERT #define KEY_LCTRL SDLK_LCTRL #define KEY_LALT SDLK_LALT @@ -67,19 +68,33 @@ #define KEY_RETURN 10 #define KEY_ENTER 11 #define KEY_ESCAPE 12 +#define KEY_INSERT 46 -#define KEY_CTRL 13 -#define KEY_ALT 14 -#define KEY_SHIFT 15 +#define KEY_LCTRL 13 +#define KEY_LALT 14 +#define KEY_LSHIFT 15 +#define KEY_RCTRL 43 +#define KEY_RALT 44 +#define KEY_RSHIFT 45 + +#define KEY_MOD_NONE 30 +#define KEY_MOD_LSHIFT 31 +#define KEY_MOD_RSHIFT 32 +#define KEY_MOD_LCONTROL 33 +#define KEY_MOD_RCONTROL 34 +#define KEY_MOD_LALT 35 +#define KEY_MOD_RALT 36 +#define KEY_MOD_LMETA 37 +#define KEY_MOD_RMETA 38 +#define KEY_MOD_NUM 39 +#define KEY_MOD_CAPS 40 +#define KEY_MOD_MODE 41 +#define KEY_MOD_RESERVED 42 #define KEY_MOD_CONTROL 16 #define KEY_MOD_ALT 17 #define KEY_MOD_SHIFT 18 -#define BUTTON_LEFT 19 -#define BUTTON_MIDDLE 20 -#define BUTTON_RIGHT 21 - #define KEY_a 22 #define KEY_d 23 #define KEY_s 24 @@ -90,4 +105,8 @@ #define KEY_F3 28 #define KEY_F5 29 +#define BUTTON_LEFT 19 +#define BUTTON_MIDDLE 20 +#define BUTTON_RIGHT 21 + #endif