Skip to content

Commit

Permalink
Quick fix: Fix dummy key defs used by renderer and other non-input bu…
Browse files Browse the repository at this point in the history
…ilds
  • Loading branch information
simtr committed Oct 29, 2013
1 parent 3f5b91f commit 67c82ee
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/gui/game/GameView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
33 changes: 26 additions & 7 deletions src/gui/interface/Keys.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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

0 comments on commit 67c82ee

Please sign in to comment.