Skip to content

Commit

Permalink
Fix inability to bind numeric keypad keys
Browse files Browse the repository at this point in the history
  • Loading branch information
CelticMinstrel committed Jul 27, 2017
1 parent ce74fe4 commit 382c469
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/gui/dialogs/hotkey_bind.cpp
Expand Up @@ -46,6 +46,8 @@ void hotkey_bind::sdl_event_callback(window& win, const SDL_Event &event)
{
if (hotkey::is_hotkeyable_event(event)) {
new_binding_ = hotkey::create_hotkey(hotkey_id_, event);
}
if(event.type == SDL_KEYUP) {
win.set_retval(window::OK);
}
}
Expand Down
65 changes: 65 additions & 0 deletions src/key.cpp
Expand Up @@ -31,6 +31,7 @@ bool CKey::is_uncomposable(const SDL_KeyboardEvent &event) {
case SDLK_ESCAPE:
case SDLK_BACKSPACE:
case SDLK_TAB:
// Function keys
case SDLK_F1:
case SDLK_F2:
case SDLK_F3:
Expand All @@ -55,12 +56,76 @@ bool CKey::is_uncomposable(const SDL_KeyboardEvent &event) {
case SDLK_F22:
case SDLK_F23:
case SDLK_F24:
// Keypad keys
case SDLK_KP_0:
case SDLK_KP_1:
case SDLK_KP_2:
case SDLK_KP_3:
case SDLK_KP_4:
case SDLK_KP_5:
case SDLK_KP_6:
case SDLK_KP_7:
case SDLK_KP_8:
case SDLK_KP_9:
case SDLK_KP_00:
case SDLK_KP_000:
case SDLK_KP_A:
case SDLK_KP_B:
case SDLK_KP_C:
case SDLK_KP_D:
case SDLK_KP_E:
case SDLK_KP_F:
case SDLK_KP_AMPERSAND:
case SDLK_KP_AT:
case SDLK_KP_BACKSPACE:
case SDLK_KP_BINARY:
case SDLK_KP_CLEAR:
case SDLK_KP_CLEARENTRY:
case SDLK_KP_COLON:
case SDLK_KP_COMMA:
case SDLK_KP_DBLAMPERSAND:
case SDLK_KP_DBLVERTICALBAR:
case SDLK_KP_DECIMAL:
case SDLK_KP_DIVIDE:
case SDLK_KP_ENTER:
case SDLK_KP_EQUALS:
case SDLK_KP_EQUALSAS400:
case SDLK_KP_EXCLAM:
case SDLK_KP_GREATER:
case SDLK_KP_HASH:
case SDLK_KP_HEXADECIMAL:
case SDLK_KP_LEFTBRACE:
case SDLK_KP_LEFTPAREN:
case SDLK_KP_LESS:
case SDLK_KP_MEMADD:
case SDLK_KP_MEMCLEAR:
case SDLK_KP_MEMDIVIDE:
case SDLK_KP_MEMMULTIPLY:
case SDLK_KP_MEMRECALL:
case SDLK_KP_MEMSTORE:
case SDLK_KP_MEMSUBTRACT:
case SDLK_KP_MINUS:
case SDLK_KP_MULTIPLY:
case SDLK_KP_OCTAL:
case SDLK_KP_PERCENT:
case SDLK_KP_PERIOD:
case SDLK_KP_PLUS:
case SDLK_KP_PLUSMINUS:
case SDLK_KP_POWER:
case SDLK_KP_RIGHTBRACE:
case SDLK_KP_RIGHTPAREN:
case SDLK_KP_SPACE:
case SDLK_KP_TAB:
case SDLK_KP_VERTICALBAR:
case SDLK_KP_XOR:
// Homepad keys
case SDLK_INSERT:
case SDLK_HOME:
case SDLK_PAGEUP:
case SDLK_PAGEDOWN:
case SDLK_DELETE:
case SDLK_END:
// Arrow keys
case SDLK_UP:
case SDLK_DOWN:
case SDLK_LEFT:
Expand Down

0 comments on commit 382c469

Please sign in to comment.