diff --git a/Source/diablo.cpp b/Source/diablo.cpp index 2ea779b27..fc2355722 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -475,10 +475,6 @@ void PressKey(SDL_Keycode vkey, uint16_t modState) if (vkey == SDLK_UNKNOWN) return; - if (vkey == SDLK_PAUSE) { - diablo_pause_game(); - return; - } if (gmenu_presskeys(vkey) || control_presskeys(vkey)) { return; } @@ -1791,6 +1787,12 @@ void InitKeymapActions() N_("Pauses the game."), 'P', diablo_pause_game); + sgOptions.Keymapper.AddAction( + "Pause Game (Alternate)", + N_("Pause Game (Alternate)"), + N_("Pauses the game."), + SDLK_PAUSE, + diablo_pause_game); sgOptions.Keymapper.AddAction( "DecreaseGamma", N_("Decrease Gamma"), diff --git a/Source/options.cpp b/Source/options.cpp index e2c7d5537..46f398622 100644 --- a/Source/options.cpp +++ b/Source/options.cpp @@ -1304,7 +1304,7 @@ std::vector LanguageOptions::GetEntries() KeymapperOptions::KeymapperOptions() : OptionCategoryBase("Keymapping", N_("Keymapping"), N_("Keymapping Settings")) { - // Insert all supported keys: a-z, 0-9 and F1-F12. + // Insert all supported keys: a-z, 0-9 and F1-F24. keyIDToKeyName.reserve(('Z' - 'A' + 1) + ('9' - '0' + 1) + 12); for (char c = 'A'; c <= 'Z'; ++c) { keyIDToKeyName.emplace(c, std::string(1, c)); @@ -1315,12 +1315,18 @@ KeymapperOptions::KeymapperOptions() for (int i = 0; i < 12; ++i) { keyIDToKeyName.emplace(SDLK_F1 + i, StrCat("F", i + 1)); } + for (int i = 0; i < 12; ++i) { + keyIDToKeyName.emplace(SDLK_F13 + i, StrCat("F", i + 13)); + } keyIDToKeyName.emplace(SDLK_LALT, "LALT"); keyIDToKeyName.emplace(SDLK_RALT, "RALT"); + keyIDToKeyName.emplace(SDLK_SPACE, "SPACE"); + keyIDToKeyName.emplace(SDLK_RCTRL, "RCONTROL"); keyIDToKeyName.emplace(SDLK_LCTRL, "LCONTROL"); + keyIDToKeyName.emplace(SDLK_PRINTSCREEN, "PRINT"); keyIDToKeyName.emplace(SDLK_PAUSE, "PAUSE"); keyIDToKeyName.emplace(SDLK_TAB, "TAB"); @@ -1328,6 +1334,29 @@ KeymapperOptions::KeymapperOptions() keyIDToKeyName.emplace(SDL_BUTTON_X1 | KeymapperMouseButtonMask, "X1MOUSE"); keyIDToKeyName.emplace(SDL_BUTTON_X2 | KeymapperMouseButtonMask, "X2MOUSE"); + keyIDToKeyName.emplace(SDLK_BACKQUOTE, "`"); + keyIDToKeyName.emplace(SDLK_LEFTBRACKET, "["); + keyIDToKeyName.emplace(SDLK_RIGHTBRACKET, "]"); + keyIDToKeyName.emplace(SDLK_BACKSLASH, "\\"); + keyIDToKeyName.emplace(SDLK_SEMICOLON, ";"); + keyIDToKeyName.emplace(SDLK_QUOTE, "'"); + keyIDToKeyName.emplace(SDLK_COMMA, ","); + keyIDToKeyName.emplace(SDLK_PERIOD, "."); + keyIDToKeyName.emplace(SDLK_SLASH, "/"); + + keyIDToKeyName.emplace(SDLK_BACKSPACE, "BACKSPACE"); + keyIDToKeyName.emplace(SDLK_CAPSLOCK, "CAPSLOCK"); + keyIDToKeyName.emplace(SDLK_SCROLLLOCK, "SCROLLLOCK"); + keyIDToKeyName.emplace(SDLK_INSERT, "INSERT"); + keyIDToKeyName.emplace(SDLK_DELETE, "DELETE"); + keyIDToKeyName.emplace(SDLK_HOME, "HOME"); + keyIDToKeyName.emplace(SDLK_END, "END"); + + keyIDToKeyName.emplace(SDLK_KP_DIVIDE, "KEYPAD /"); + keyIDToKeyName.emplace(SDLK_KP_MULTIPLY, "KEYPAD *"); + keyIDToKeyName.emplace(SDLK_KP_ENTER, "KEYPAD ENTER"); + keyIDToKeyName.emplace(SDLK_KP_PERIOD, "KEYPAD DECIMAL"); + keyNameToKeyID.reserve(keyIDToKeyName.size()); for (const auto &kv : keyIDToKeyName) { keyNameToKeyID.emplace(kv.second, kv.first); diff --git a/Translations/devilutionx.pot b/Translations/devilutionx.pot index 0b3e86ca0..59ecaad66 100644 --- a/Translations/devilutionx.pot +++ b/Translations/devilutionx.pot @@ -1525,6 +1525,10 @@ msgstr "" msgid "Pause Game" msgstr "" +#: Source/diablo.cpp:1792 +msgid "Pause Game (Alternate)" +msgstr "" + #: Source/diablo.cpp:1897 Source/diablo.cpp:1903 Source/diablo.cpp:2388 msgid "Pauses the game." msgstr "" diff --git a/Translations/es.po b/Translations/es.po index d5284a992..e5f55a936 100644 --- a/Translations/es.po +++ b/Translations/es.po @@ -1492,6 +1492,10 @@ msgstr "Pausar Juego" msgid "Pauses the game." msgstr "Pausar el juego." +#: Source/diablo.cpp:1792 +msgid "Pause Game (Alternate)" +msgstr "Pausar juego (alternativo)" + #: Source/diablo.cpp:1771 Source/diablo.cpp:2241 msgid "Decrease Gamma" msgstr "Disminuir Gamma" diff --git a/Translations/it.po b/Translations/it.po index dc6047964..67d2e6ca6 100644 --- a/Translations/it.po +++ b/Translations/it.po @@ -1577,7 +1577,11 @@ msgstr "Sospendi Partita" msgid "Pauses the game." msgstr "Sospende la partita." -#: Source/diablo.cpp:1796 Source/diablo.cpp:2264 +#: Source/diablo.cpp:1792 +msgid "Pause Game (Alternate)" +msgstr "Sospendi Partita (Alternativo)" + +#: Source/diablo.cpp:1781 Source/diablo.cpp:2249 msgid "Decrease Gamma" msgstr "Diminuisci Gamma" diff --git a/Translations/ja.po b/Translations/ja.po index 869eff32d..2ddbd9e5c 100644 --- a/Translations/ja.po +++ b/Translations/ja.po @@ -1530,6 +1530,10 @@ msgstr "ゲーム​の​一時停止" msgid "Pauses the game." msgstr "ゲーム​を​一時停止​し​ます。" +#: Source/diablo.cpp:1792 +msgid "Pause Game (Alternate)" +msgstr "ゲーム​の​一時停止" + #: Source/diablo.cpp:1782 Source/diablo.cpp:2250 msgid "Decrease Gamma" msgstr "ガンマ​値​を​下げる" diff --git a/Translations/pl.po b/Translations/pl.po index fc99e65a5..85eb569ba 100644 --- a/Translations/pl.po +++ b/Translations/pl.po @@ -371,7 +371,7 @@ msgstr "Klient-Serwer (TCP)" #: Source/DiabloUI/selconn.cpp:15 #, fuzzy -msgid "Offline" +msgid "Offline" msgstr "Loopback" #: Source/DiabloUI/selconn.cpp:54 Source/DiabloUI/selgame.cpp:604 @@ -1379,6 +1379,10 @@ msgstr "Wstrzymaj grę" msgid "Pauses the game." msgstr "Wstrzymuje grę." +#: Source/diablo.cpp:1792 +msgid "Pause Game (Alternate)" +msgstr "Wstrzymaj grę (alternatywnie)" + #: Source/diablo.cpp:1616 msgid "Decrease Gamma" msgstr "Zmniejsz jasność" diff --git a/Translations/uk.po b/Translations/uk.po index 1ef0a397f..0ce87e834 100644 --- a/Translations/uk.po +++ b/Translations/uk.po @@ -1566,7 +1566,11 @@ msgstr "Зупинити Гру" msgid "Pauses the game." msgstr "Ставить гру на паузу." -#: Source/diablo.cpp:1796 Source/diablo.cpp:2264 +#: Source/diablo.cpp:1792 +msgid "Pause Game (Alternate)" +msgstr "Зупинити гру (Альтернатива)" + +#: Source/diablo.cpp:1782 Source/diablo.cpp:2250 msgid "Decrease Gamma" msgstr "Зменшити Гамму" diff --git a/Translations/zh_CN.po b/Translations/zh_CN.po index e7e484432..471ff435d 100644 --- a/Translations/zh_CN.po +++ b/Translations/zh_CN.po @@ -369,7 +369,7 @@ msgstr "客户​端​-​服务器​(​TCP)" #: Source/DiabloUI/selconn.cpp:15 #, fuzzy -msgid "Offline" +msgid "Offline" msgstr "回环" #: Source/DiabloUI/selconn.cpp:54 Source/DiabloUI/selgame.cpp:604 @@ -1352,6 +1352,10 @@ msgstr "暂停​游戏" msgid "Pauses the game." msgstr "暂停​当前​游戏。" +#: Source/diablo.cpp:1792 +msgid "Pause Game (Alternate)" +msgstr "暂停​游戏(备用)" + #: Source/diablo.cpp:1618 msgid "Decrease Gamma" msgstr "减少​伽马"