1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-16 18:01:40 +00:00

Clarify some keycode names

fixes #16258
This commit is contained in:
sfan5 2025-08-10 16:37:14 +02:00
parent 21a76d8c88
commit b6065797ce
2 changed files with 29 additions and 28 deletions

View file

@ -1408,7 +1408,7 @@ void CIrrDeviceSDL::createKeyMap()
// select missing // select missing
KeyMap.emplace(SDLK_PRINTSCREEN, KEY_PRINT); KeyMap.emplace(SDLK_PRINTSCREEN, KEY_PRINT);
// execute missing // execute missing
KeyMap.emplace(SDLK_PRINTSCREEN, KEY_SNAPSHOT); // snapshot missing
KeyMap.emplace(SDLK_INSERT, KEY_INSERT); KeyMap.emplace(SDLK_INSERT, KEY_INSERT);
KeyMap.emplace(SDLK_DELETE, KEY_DELETE); KeyMap.emplace(SDLK_DELETE, KEY_DELETE);

View file

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