diff --git a/irr/src/CIrrDeviceSDL.cpp b/irr/src/CIrrDeviceSDL.cpp index 52f8c217f..a44213d7c 100644 --- a/irr/src/CIrrDeviceSDL.cpp +++ b/irr/src/CIrrDeviceSDL.cpp @@ -1408,7 +1408,7 @@ void CIrrDeviceSDL::createKeyMap() // select missing KeyMap.emplace(SDLK_PRINTSCREEN, KEY_PRINT); // execute missing - KeyMap.emplace(SDLK_PRINTSCREEN, KEY_SNAPSHOT); + // snapshot missing KeyMap.emplace(SDLK_INSERT, KEY_INSERT); KeyMap.emplace(SDLK_DELETE, KEY_DELETE); diff --git a/src/client/keycode.cpp b/src/client/keycode.cpp index e21bc6308..50adcca88 100644 --- a/src/client/keycode.cpp +++ b/src/client/keycode.cpp @@ -25,11 +25,11 @@ struct table_key { #define DEFINEKEY2(x, ch, lang) /* Irrlicht key with character */ \ { #x, x, ch, lang }, #define DEFINEKEY3(ch) /* single Irrlicht key (e.g. KEY_KEY_X) */ \ - { "KEY_KEY_" TOSTRING(ch), KEY_KEY_ ## ch, (wchar_t) *TOSTRING(ch), TOSTRING(ch) }, + { "KEY_KEY_" TOSTRING(ch), KEY_KEY_ ## ch, static_cast(*TOSTRING(ch)), TOSTRING(ch) }, #define DEFINEKEY4(ch) /* single Irrlicht function key (e.g. KEY_F3) */ \ { "KEY_F" TOSTRING(ch), KEY_F ## ch, L'\0', "F" TOSTRING(ch) }, #define DEFINEKEY5(ch) /* key without Irrlicht keycode */ \ - { ch, KEY_KEY_CODES_COUNT, (wchar_t) *ch, ch }, + { ch, KEY_KEY_CODES_COUNT, static_cast(*ch), ch }, #define N_(text) text @@ -77,20 +77,20 @@ static std::vector table = { DEFINEKEY2(KEY_PERIOD, L'.', ".") // Keys without a Char - DEFINEKEY1(KEY_LBUTTON, N_("Left Button")) - DEFINEKEY1(KEY_RBUTTON, N_("Right Button")) + // Note: we add "Key" to the description if the string could be confused for something else + DEFINEKEY1(KEY_LBUTTON, N_("Left Click")) + DEFINEKEY1(KEY_RBUTTON, N_("Right Click")) //~ Usually paired with the Pause key DEFINEKEY1(KEY_CANCEL, N_("Break Key")) - DEFINEKEY1(KEY_MBUTTON, N_("Middle Button")) - DEFINEKEY1(KEY_XBUTTON1, N_("X Button 1")) - DEFINEKEY1(KEY_XBUTTON2, N_("X Button 2")) + DEFINEKEY1(KEY_MBUTTON, N_("Middle Click")) + DEFINEKEY1(KEY_XBUTTON1, N_("Mouse X1")) + DEFINEKEY1(KEY_XBUTTON2, N_("Mouse X2")) DEFINEKEY1(KEY_BACK, N_("Backspace")) - DEFINEKEY1(KEY_TAB, N_("Tab")) + DEFINEKEY1(KEY_TAB, N_("Tab Key")) DEFINEKEY1(KEY_CLEAR, N_("Clear Key")) DEFINEKEY1(KEY_RETURN, N_("Return Key")) DEFINEKEY1(KEY_SHIFT, N_("Shift Key")) DEFINEKEY1(KEY_CONTROL, N_("Control Key")) - //~ Key name, common on Windows keyboards DEFINEKEY1(KEY_MENU, N_("Menu Key")) //~ Usually paired with the Break key DEFINEKEY1(KEY_PAUSE, N_("Pause Key")) @@ -98,22 +98,21 @@ static std::vector table = { DEFINEKEY1(KEY_SPACE, N_("Space")) DEFINEKEY1(KEY_PRIOR, N_("Page Up")) DEFINEKEY1(KEY_NEXT, N_("Page Down")) - DEFINEKEY1(KEY_END, N_("End")) - DEFINEKEY1(KEY_HOME, N_("Home")) + DEFINEKEY1(KEY_END, N_("End Key")) + DEFINEKEY1(KEY_HOME, N_("Home Key")) DEFINEKEY1(KEY_LEFT, N_("Left Arrow")) DEFINEKEY1(KEY_UP, N_("Up Arrow")) DEFINEKEY1(KEY_RIGHT, N_("Right Arrow")) DEFINEKEY1(KEY_DOWN, N_("Down Arrow")) - //~ Key name - DEFINEKEY1(KEY_SELECT, N_("Select")) + DEFINEKEY1(KEY_SELECT, N_("Select Key")) //~ "Print screen" key DEFINEKEY1(KEY_PRINT, N_("Print")) - DEFINEKEY1(KEY_EXECUT, N_("Execute")) - DEFINEKEY1(KEY_SNAPSHOT, N_("Snapshot")) DEFINEKEY1(KEY_INSERT, N_("Insert")) DEFINEKEY1(KEY_DELETE, N_("Delete Key")) - DEFINEKEY1(KEY_HELP, N_("Help")) + DEFINEKEY1(KEY_HELP, N_("Help Key")) + //~ Name of key DEFINEKEY1(KEY_LWIN, N_("Left Windows")) + //~ Name of key DEFINEKEY1(KEY_RWIN, N_("Right Windows")) DEFINEKEY1(KEY_NUMPAD0, N_("Numpad 0")) // These are not assigned to a char DEFINEKEY1(KEY_NUMPAD1, N_("Numpad 1")) // to prevent interference with KEY_KEY_[0-9]. @@ -129,7 +128,7 @@ static std::vector table = { DEFINEKEY1(KEY_ADD, N_("Numpad +")) DEFINEKEY1(KEY_SEPARATOR, N_("Numpad .")) DEFINEKEY1(KEY_SUBTRACT, N_("Numpad -")) - DEFINEKEY1(KEY_DECIMAL, N_("Numpad .")) + DEFINEKEY1(KEY_DECIMAL, N_("Numpad .")) // duplicate of KEY_SEPARATOR? DEFINEKEY1(KEY_DIVIDE, N_("Numpad /")) DEFINEKEY4(1) DEFINEKEY4(2) @@ -172,13 +171,15 @@ static std::vector table = { DEFINEKEY1(KEY_FINAL, "Final") DEFINEKEY1(KEY_KANJI, "Kanji") DEFINEKEY1(KEY_HANJA, "Hanja") - DEFINEKEY1(KEY_ESCAPE, N_("IME Escape")) - DEFINEKEY1(KEY_CONVERT, N_("IME Convert")) - DEFINEKEY1(KEY_NONCONVERT, N_("IME Nonconvert")) - DEFINEKEY1(KEY_ACCEPT, N_("IME Accept")) - DEFINEKEY1(KEY_MODECHANGE, N_("IME Mode Change")) - DEFINEKEY1(KEY_APPS, N_("Apps")) - DEFINEKEY1(KEY_SLEEP, N_("Sleep")) + DEFINEKEY1(KEY_ESCAPE, "IME Escape") + DEFINEKEY1(KEY_CONVERT, "IME Convert") + DEFINEKEY1(KEY_NONCONVERT, "IME Nonconvert") + DEFINEKEY1(KEY_ACCEPT, "IME Accept") + DEFINEKEY1(KEY_MODECHANGE, "IME Mode Change") + DEFINEKEY1(KEY_EXECUT, "Execute Key") + DEFINEKEY1(KEY_SNAPSHOT, "Snapshot Key") + DEFINEKEY1(KEY_APPS, "Apps Key") + DEFINEKEY1(KEY_SLEEP, "Sleep Key") DEFINEKEY1(KEY_OEM_1, "OEM 1") // KEY_OEM_[0-9] and KEY_OEM_102 are assigned to multiple DEFINEKEY1(KEY_OEM_2, "OEM 2") // different chars (on different platforms too) and thus w/o char DEFINEKEY1(KEY_OEM_3, "OEM 3") @@ -192,11 +193,11 @@ static std::vector table = { DEFINEKEY1(KEY_ATTN, "Attn") DEFINEKEY1(KEY_CRSEL, "CrSel") DEFINEKEY1(KEY_EXSEL, "ExSel") - DEFINEKEY1(KEY_EREOF, N_("Erase EOF")) + DEFINEKEY1(KEY_EREOF, "Erase EOF") DEFINEKEY1(KEY_PLAY, N_("Play")) - DEFINEKEY1(KEY_ZOOM, N_("Zoom Key")) + DEFINEKEY1(KEY_ZOOM, "Zoom Key") DEFINEKEY1(KEY_PA1, "PA1") - DEFINEKEY1(KEY_OEM_CLEAR, N_("OEM Clear")) + DEFINEKEY1(KEY_OEM_CLEAR, "OEM Clear") // Keys without Irrlicht keycode DEFINEKEY5("!")