From 8e62e252525a7410e6877d3d81eafc6dcbcbaf79 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 27 Mar 2012 01:40:22 +0300 Subject: Fix shortcuts handling in setup window. --- src/inputmanager.h | 1 + src/keyboarddata.h | 40 ++++++++++++++++++++-------------------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/inputmanager.h b/src/inputmanager.h index 82def2c33..3276e979b 100644 --- a/src/inputmanager.h +++ b/src/inputmanager.h @@ -40,6 +40,7 @@ enum KeyCondition COND_NONPCINPUT = 128, // npc input field inactive COND_EMODS = 256, // game modifiers enabled COND_NOTARGET = 512, // no target/untarget keys pressed + COND_SHORTCUT = 2 + 4 + 16 + 512, // flags for shortcut keys COND_GAME = 2 + 4 + 8 + 16 + 64, // main game key COND_GAME2 = 2 + 8 + 16 + 64 }; diff --git a/src/keyboarddata.h b/src/keyboarddata.h index 0ab325c52..516649103 100644 --- a/src/keyboarddata.h +++ b/src/keyboarddata.h @@ -228,121 +228,121 @@ static KeyData const keyData[KeyboardConfig::KEY_TOTAL] = { KeyboardConfig::GRP_DEFAULT, &ActionManager::shortcut, KeyboardConfig::KEY_NO_VALUE, 50, - COND_NOTARGET | COND_NOINPUT | COND_ENABLED}, + COND_SHORTCUT}, {"keyShortcut2", SDLK_2, strprintf(N_("Item Shortcut %d"), 2), KeyboardConfig::GRP_DEFAULT, &ActionManager::shortcut, KeyboardConfig::KEY_NO_VALUE, 50, - COND_NOTARGET | COND_NOINPUT | COND_ENABLED}, + COND_SHORTCUT}, {"keyShortcut3", SDLK_3, strprintf(N_("Item Shortcut %d"), 3), KeyboardConfig::GRP_DEFAULT, &ActionManager::shortcut, KeyboardConfig::KEY_NO_VALUE, 50, - COND_NOTARGET | COND_NOINPUT | COND_ENABLED}, + COND_SHORTCUT}, {"keyShortcut4", SDLK_4, strprintf(N_("Item Shortcut %d"), 4), KeyboardConfig::GRP_DEFAULT, &ActionManager::shortcut, KeyboardConfig::KEY_NO_VALUE, 50, - COND_NOTARGET | COND_NOINPUT | COND_ENABLED}, + COND_SHORTCUT}, {"keyShortcut5", SDLK_5, strprintf(N_("Item Shortcut %d"), 5), KeyboardConfig::GRP_DEFAULT, &ActionManager::shortcut, KeyboardConfig::KEY_NO_VALUE, 50, - COND_NOTARGET | COND_NOINPUT | COND_ENABLED}, + COND_SHORTCUT}, {"keyShortcut6", SDLK_6, strprintf(N_("Item Shortcut %d"), 6), KeyboardConfig::GRP_DEFAULT, &ActionManager::shortcut, KeyboardConfig::KEY_NO_VALUE, 50, - COND_NOTARGET | COND_NOINPUT | COND_ENABLED}, + COND_SHORTCUT}, {"keyShortcut7", SDLK_7, strprintf(N_("Item Shortcut %d"), 7), KeyboardConfig::GRP_DEFAULT, &ActionManager::shortcut, KeyboardConfig::KEY_NO_VALUE, 50, - COND_NOTARGET | COND_NOINPUT | COND_ENABLED}, + COND_SHORTCUT}, {"keyShortcut8", SDLK_8, strprintf(N_("Item Shortcut %d"), 8), KeyboardConfig::GRP_DEFAULT, &ActionManager::shortcut, KeyboardConfig::KEY_NO_VALUE, 50, - COND_NOTARGET | COND_NOINPUT | COND_ENABLED}, + COND_SHORTCUT}, {"keyShortcut9", SDLK_9, strprintf(N_("Item Shortcut %d"), 9), KeyboardConfig::GRP_DEFAULT, &ActionManager::shortcut, KeyboardConfig::KEY_NO_VALUE, 50, - COND_NOTARGET | COND_NOINPUT | COND_ENABLED}, + COND_SHORTCUT}, {"keyShortcut10", SDLK_0, strprintf(N_("Item Shortcut %d"), 10), KeyboardConfig::GRP_DEFAULT, &ActionManager::shortcut, KeyboardConfig::KEY_NO_VALUE, 50, - COND_NOTARGET | COND_NOINPUT | COND_ENABLED}, + COND_SHORTCUT}, {"keyShortcut11", SDLK_MINUS, strprintf(N_("Item Shortcut %d"), 11), KeyboardConfig::GRP_DEFAULT, &ActionManager::shortcut, KeyboardConfig::KEY_NO_VALUE, 50, - COND_NOTARGET | COND_NOINPUT | COND_ENABLED}, + COND_SHORTCUT}, {"keyShortcut12", SDLK_EQUALS, strprintf(N_("Item Shortcut %d"), 12), KeyboardConfig::GRP_DEFAULT, &ActionManager::shortcut, KeyboardConfig::KEY_NO_VALUE, 50, - COND_NOTARGET | COND_NOINPUT | COND_ENABLED}, + COND_SHORTCUT}, {"keyShortcut13", SDLK_BACKSPACE, strprintf(N_("Item Shortcut %d"), 13), KeyboardConfig::GRP_DEFAULT, &ActionManager::shortcut, KeyboardConfig::KEY_NO_VALUE, 50, - COND_NOTARGET | COND_NOINPUT | COND_ENABLED}, + COND_SHORTCUT}, {"keyShortcut14", SDLK_INSERT, strprintf(N_("Item Shortcut %d"), 14), KeyboardConfig::GRP_DEFAULT, &ActionManager::shortcut, KeyboardConfig::KEY_NO_VALUE, 50, - COND_NOTARGET | COND_NOINPUT | COND_ENABLED}, + COND_SHORTCUT}, {"keyShortcut15", SDLK_HOME, strprintf(N_("Item Shortcut %d"), 15), KeyboardConfig::GRP_DEFAULT, &ActionManager::shortcut, KeyboardConfig::KEY_NO_VALUE, 50, - COND_NOTARGET | COND_NOINPUT | COND_ENABLED}, + COND_SHORTCUT}, {"keyShortcut16", KeyboardConfig::KEY_NO_VALUE, strprintf(N_("Item Shortcut %d"), 16), KeyboardConfig::GRP_DEFAULT, &ActionManager::shortcut, KeyboardConfig::KEY_NO_VALUE, 50, - COND_NOTARGET | COND_NOINPUT | COND_ENABLED}, + COND_SHORTCUT}, {"keyShortcut17", KeyboardConfig::KEY_NO_VALUE, strprintf(N_("Item Shortcut %d"), 17), KeyboardConfig::GRP_DEFAULT, &ActionManager::shortcut, KeyboardConfig::KEY_NO_VALUE, 50, - COND_NOTARGET | COND_NOINPUT | COND_ENABLED}, + COND_SHORTCUT}, {"keyShortcut18", KeyboardConfig::KEY_NO_VALUE, strprintf(N_("Item Shortcut %d"), 18), KeyboardConfig::GRP_DEFAULT, &ActionManager::shortcut, KeyboardConfig::KEY_NO_VALUE, 50, - COND_NOTARGET | COND_NOINPUT | COND_ENABLED}, + COND_SHORTCUT}, {"keyShortcut19", KeyboardConfig::KEY_NO_VALUE, strprintf(N_("Item Shortcut %d"), 19), KeyboardConfig::GRP_DEFAULT, &ActionManager::shortcut, KeyboardConfig::KEY_NO_VALUE, 50, - COND_NOTARGET | COND_NOINPUT | COND_ENABLED}, + COND_SHORTCUT}, {"keyShortcut20", KeyboardConfig::KEY_NO_VALUE, strprintf(N_("Item Shortcut %d"), 20), KeyboardConfig::GRP_DEFAULT, &ActionManager::shortcut, KeyboardConfig::KEY_NO_VALUE, 50, - COND_NOTARGET | COND_NOINPUT | COND_ENABLED}, + COND_SHORTCUT}, {"", 0, N_("Windows Keys"), 0, -- cgit v1.2.3-70-g09d2