mirror of
https://github.com/stenzek/duckstation.git
synced 2025-06-07 03:55:33 +00:00
ImGuiManager: Fix tab key handling
This commit is contained in:
parent
c9ae4dcd0f
commit
9c819d9676
@ -448,110 +448,114 @@ void ImGuiManager::SetKeyMap()
|
||||
const char* alt_name;
|
||||
};
|
||||
|
||||
static constexpr KeyMapping mapping[] = {{ImGuiKey_LeftArrow, "Left", nullptr},
|
||||
{ImGuiKey_RightArrow, "Right", nullptr},
|
||||
{ImGuiKey_UpArrow, "Up", nullptr},
|
||||
{ImGuiKey_DownArrow, "Down", nullptr},
|
||||
{ImGuiKey_PageUp, "PageUp", nullptr},
|
||||
{ImGuiKey_PageDown, "PageDown", nullptr},
|
||||
{ImGuiKey_Home, "Home", nullptr},
|
||||
{ImGuiKey_End, "End", nullptr},
|
||||
{ImGuiKey_Insert, "Insert", nullptr},
|
||||
{ImGuiKey_Delete, "Delete", nullptr},
|
||||
{ImGuiKey_Backspace, "Backspace", nullptr},
|
||||
{ImGuiKey_Space, "Space", nullptr},
|
||||
{ImGuiKey_Enter, "Return", nullptr},
|
||||
{ImGuiKey_Escape, "Escape", nullptr},
|
||||
{ImGuiKey_LeftCtrl, "LeftControl", "Control"},
|
||||
{ImGuiKey_LeftShift, "LeftShift", "Shift"},
|
||||
{ImGuiKey_LeftAlt, "LeftAlt", "Alt"},
|
||||
{ImGuiKey_LeftSuper, "LeftSuper", "Super"},
|
||||
{ImGuiKey_RightCtrl, "RightControl", nullptr},
|
||||
{ImGuiKey_RightShift, "RightShift", nullptr},
|
||||
{ImGuiKey_RightAlt, "RightAlt", nullptr},
|
||||
{ImGuiKey_RightSuper, "RightSuper", nullptr},
|
||||
{ImGuiKey_Menu, "Menu", nullptr},
|
||||
{ImGuiKey_0, "0", nullptr},
|
||||
{ImGuiKey_1, "1", nullptr},
|
||||
{ImGuiKey_2, "2", nullptr},
|
||||
{ImGuiKey_3, "3", nullptr},
|
||||
{ImGuiKey_4, "4", nullptr},
|
||||
{ImGuiKey_5, "5", nullptr},
|
||||
{ImGuiKey_6, "6", nullptr},
|
||||
{ImGuiKey_7, "7", nullptr},
|
||||
{ImGuiKey_8, "8", nullptr},
|
||||
{ImGuiKey_9, "9", nullptr},
|
||||
{ImGuiKey_A, "A", nullptr},
|
||||
{ImGuiKey_B, "B", nullptr},
|
||||
{ImGuiKey_C, "C", nullptr},
|
||||
{ImGuiKey_D, "D", nullptr},
|
||||
{ImGuiKey_E, "E", nullptr},
|
||||
{ImGuiKey_F, "F", nullptr},
|
||||
{ImGuiKey_G, "G", nullptr},
|
||||
{ImGuiKey_H, "H", nullptr},
|
||||
{ImGuiKey_I, "I", nullptr},
|
||||
{ImGuiKey_J, "J", nullptr},
|
||||
{ImGuiKey_K, "K", nullptr},
|
||||
{ImGuiKey_L, "L", nullptr},
|
||||
{ImGuiKey_M, "M", nullptr},
|
||||
{ImGuiKey_N, "N", nullptr},
|
||||
{ImGuiKey_O, "O", nullptr},
|
||||
{ImGuiKey_P, "P", nullptr},
|
||||
{ImGuiKey_Q, "Q", nullptr},
|
||||
{ImGuiKey_R, "R", nullptr},
|
||||
{ImGuiKey_S, "S", nullptr},
|
||||
{ImGuiKey_T, "T", nullptr},
|
||||
{ImGuiKey_U, "U", nullptr},
|
||||
{ImGuiKey_V, "V", nullptr},
|
||||
{ImGuiKey_W, "W", nullptr},
|
||||
{ImGuiKey_X, "X", nullptr},
|
||||
{ImGuiKey_Y, "Y", nullptr},
|
||||
{ImGuiKey_Z, "Z", nullptr},
|
||||
{ImGuiKey_F1, "F1", nullptr},
|
||||
{ImGuiKey_F2, "F2", nullptr},
|
||||
{ImGuiKey_F3, "F3", nullptr},
|
||||
{ImGuiKey_F4, "F4", nullptr},
|
||||
{ImGuiKey_F5, "F5", nullptr},
|
||||
{ImGuiKey_F6, "F6", nullptr},
|
||||
{ImGuiKey_F7, "F7", nullptr},
|
||||
{ImGuiKey_F8, "F8", nullptr},
|
||||
{ImGuiKey_F9, "F9", nullptr},
|
||||
{ImGuiKey_F10, "F10", nullptr},
|
||||
{ImGuiKey_F11, "F11", nullptr},
|
||||
{ImGuiKey_F12, "F12", nullptr},
|
||||
{ImGuiKey_Apostrophe, "Apostrophe", nullptr},
|
||||
{ImGuiKey_Comma, "Comma", nullptr},
|
||||
{ImGuiKey_Minus, "Minus", nullptr},
|
||||
{ImGuiKey_Period, "Period", nullptr},
|
||||
{ImGuiKey_Slash, "Slash", nullptr},
|
||||
{ImGuiKey_Semicolon, "Semicolon", nullptr},
|
||||
{ImGuiKey_Equal, "Equal", nullptr},
|
||||
{ImGuiKey_LeftBracket, "BracketLeft", nullptr},
|
||||
{ImGuiKey_Backslash, "Backslash", nullptr},
|
||||
{ImGuiKey_RightBracket, "BracketRight", nullptr},
|
||||
{ImGuiKey_GraveAccent, "QuoteLeft", nullptr},
|
||||
{ImGuiKey_CapsLock, "CapsLock", nullptr},
|
||||
{ImGuiKey_ScrollLock, "ScrollLock", nullptr},
|
||||
{ImGuiKey_NumLock, "NumLock", nullptr},
|
||||
{ImGuiKey_PrintScreen, "PrintScreen", nullptr},
|
||||
{ImGuiKey_Pause, "Pause", nullptr},
|
||||
{ImGuiKey_Keypad0, "Keypad0", nullptr},
|
||||
{ImGuiKey_Keypad1, "Keypad1", nullptr},
|
||||
{ImGuiKey_Keypad2, "Keypad2", nullptr},
|
||||
{ImGuiKey_Keypad3, "Keypad3", nullptr},
|
||||
{ImGuiKey_Keypad4, "Keypad4", nullptr},
|
||||
{ImGuiKey_Keypad5, "Keypad5", nullptr},
|
||||
{ImGuiKey_Keypad6, "Keypad6", nullptr},
|
||||
{ImGuiKey_Keypad7, "Keypad7", nullptr},
|
||||
{ImGuiKey_Keypad8, "Keypad8", nullptr},
|
||||
{ImGuiKey_Keypad9, "Keypad9", nullptr},
|
||||
{ImGuiKey_KeypadDecimal, "KeypadPeriod", nullptr},
|
||||
{ImGuiKey_KeypadDivide, "KeypadDivide", nullptr},
|
||||
{ImGuiKey_KeypadMultiply, "KeypadMultiply", nullptr},
|
||||
{ImGuiKey_KeypadSubtract, "KeypadMinus", nullptr},
|
||||
{ImGuiKey_KeypadAdd, "KeypadPlus", nullptr},
|
||||
{ImGuiKey_KeypadEnter, "KeypadReturn", nullptr},
|
||||
{ImGuiKey_KeypadEqual, "KeypadEqual", nullptr}};
|
||||
static constexpr KeyMapping mapping[] = {
|
||||
{ImGuiKey_LeftArrow, "Left", nullptr},
|
||||
{ImGuiKey_RightArrow, "Right", nullptr},
|
||||
{ImGuiKey_UpArrow, "Up", nullptr},
|
||||
{ImGuiKey_DownArrow, "Down", nullptr},
|
||||
{ImGuiKey_PageUp, "PageUp", nullptr},
|
||||
{ImGuiKey_PageDown, "PageDown", nullptr},
|
||||
{ImGuiKey_Home, "Home", nullptr},
|
||||
{ImGuiKey_End, "End", nullptr},
|
||||
{ImGuiKey_Insert, "Insert", nullptr},
|
||||
{ImGuiKey_Delete, "Delete", nullptr},
|
||||
{ImGuiKey_Backspace, "Backspace", nullptr},
|
||||
{ImGuiKey_Space, "Space", nullptr},
|
||||
{ImGuiKey_Enter, "Return", nullptr},
|
||||
{ImGuiKey_Escape, "Escape", nullptr},
|
||||
{ImGuiKey_LeftCtrl, "LeftControl", "Control"},
|
||||
{ImGuiKey_LeftShift, "LeftShift", "Shift"},
|
||||
{ImGuiKey_LeftAlt, "LeftAlt", "Alt"},
|
||||
{ImGuiKey_LeftSuper, "LeftSuper", "Super"},
|
||||
{ImGuiKey_RightCtrl, "RightControl", nullptr},
|
||||
{ImGuiKey_RightShift, "RightShift", nullptr},
|
||||
{ImGuiKey_RightAlt, "RightAlt", nullptr},
|
||||
{ImGuiKey_RightSuper, "RightSuper", nullptr},
|
||||
{ImGuiKey_Menu, "Menu", nullptr},
|
||||
{ImGuiKey_Tab, "Tab", nullptr},
|
||||
// Hack: Report Qt's "Backtab" as Tab, we forward the shift so it gets mapped correctly
|
||||
{ImGuiKey_Tab, "Backtab", nullptr},
|
||||
{ImGuiKey_0, "0", nullptr},
|
||||
{ImGuiKey_1, "1", nullptr},
|
||||
{ImGuiKey_2, "2", nullptr},
|
||||
{ImGuiKey_3, "3", nullptr},
|
||||
{ImGuiKey_4, "4", nullptr},
|
||||
{ImGuiKey_5, "5", nullptr},
|
||||
{ImGuiKey_6, "6", nullptr},
|
||||
{ImGuiKey_7, "7", nullptr},
|
||||
{ImGuiKey_8, "8", nullptr},
|
||||
{ImGuiKey_9, "9", nullptr},
|
||||
{ImGuiKey_A, "A", nullptr},
|
||||
{ImGuiKey_B, "B", nullptr},
|
||||
{ImGuiKey_C, "C", nullptr},
|
||||
{ImGuiKey_D, "D", nullptr},
|
||||
{ImGuiKey_E, "E", nullptr},
|
||||
{ImGuiKey_F, "F", nullptr},
|
||||
{ImGuiKey_G, "G", nullptr},
|
||||
{ImGuiKey_H, "H", nullptr},
|
||||
{ImGuiKey_I, "I", nullptr},
|
||||
{ImGuiKey_J, "J", nullptr},
|
||||
{ImGuiKey_K, "K", nullptr},
|
||||
{ImGuiKey_L, "L", nullptr},
|
||||
{ImGuiKey_M, "M", nullptr},
|
||||
{ImGuiKey_N, "N", nullptr},
|
||||
{ImGuiKey_O, "O", nullptr},
|
||||
{ImGuiKey_P, "P", nullptr},
|
||||
{ImGuiKey_Q, "Q", nullptr},
|
||||
{ImGuiKey_R, "R", nullptr},
|
||||
{ImGuiKey_S, "S", nullptr},
|
||||
{ImGuiKey_T, "T", nullptr},
|
||||
{ImGuiKey_U, "U", nullptr},
|
||||
{ImGuiKey_V, "V", nullptr},
|
||||
{ImGuiKey_W, "W", nullptr},
|
||||
{ImGuiKey_X, "X", nullptr},
|
||||
{ImGuiKey_Y, "Y", nullptr},
|
||||
{ImGuiKey_Z, "Z", nullptr},
|
||||
{ImGuiKey_F1, "F1", nullptr},
|
||||
{ImGuiKey_F2, "F2", nullptr},
|
||||
{ImGuiKey_F3, "F3", nullptr},
|
||||
{ImGuiKey_F4, "F4", nullptr},
|
||||
{ImGuiKey_F5, "F5", nullptr},
|
||||
{ImGuiKey_F6, "F6", nullptr},
|
||||
{ImGuiKey_F7, "F7", nullptr},
|
||||
{ImGuiKey_F8, "F8", nullptr},
|
||||
{ImGuiKey_F9, "F9", nullptr},
|
||||
{ImGuiKey_F10, "F10", nullptr},
|
||||
{ImGuiKey_F11, "F11", nullptr},
|
||||
{ImGuiKey_F12, "F12", nullptr},
|
||||
{ImGuiKey_Apostrophe, "Apostrophe", nullptr},
|
||||
{ImGuiKey_Comma, "Comma", nullptr},
|
||||
{ImGuiKey_Minus, "Minus", nullptr},
|
||||
{ImGuiKey_Period, "Period", nullptr},
|
||||
{ImGuiKey_Slash, "Slash", nullptr},
|
||||
{ImGuiKey_Semicolon, "Semicolon", nullptr},
|
||||
{ImGuiKey_Equal, "Equal", nullptr},
|
||||
{ImGuiKey_LeftBracket, "BracketLeft", nullptr},
|
||||
{ImGuiKey_Backslash, "Backslash", nullptr},
|
||||
{ImGuiKey_RightBracket, "BracketRight", nullptr},
|
||||
{ImGuiKey_GraveAccent, "QuoteLeft", nullptr},
|
||||
{ImGuiKey_CapsLock, "CapsLock", nullptr},
|
||||
{ImGuiKey_ScrollLock, "ScrollLock", nullptr},
|
||||
{ImGuiKey_NumLock, "NumLock", nullptr},
|
||||
{ImGuiKey_PrintScreen, "PrintScreen", nullptr},
|
||||
{ImGuiKey_Pause, "Pause", nullptr},
|
||||
{ImGuiKey_Keypad0, "Keypad0", nullptr},
|
||||
{ImGuiKey_Keypad1, "Keypad1", nullptr},
|
||||
{ImGuiKey_Keypad2, "Keypad2", nullptr},
|
||||
{ImGuiKey_Keypad3, "Keypad3", nullptr},
|
||||
{ImGuiKey_Keypad4, "Keypad4", nullptr},
|
||||
{ImGuiKey_Keypad5, "Keypad5", nullptr},
|
||||
{ImGuiKey_Keypad6, "Keypad6", nullptr},
|
||||
{ImGuiKey_Keypad7, "Keypad7", nullptr},
|
||||
{ImGuiKey_Keypad8, "Keypad8", nullptr},
|
||||
{ImGuiKey_Keypad9, "Keypad9", nullptr},
|
||||
{ImGuiKey_KeypadDecimal, "KeypadPeriod", nullptr},
|
||||
{ImGuiKey_KeypadDivide, "KeypadDivide", nullptr},
|
||||
{ImGuiKey_KeypadMultiply, "KeypadMultiply", nullptr},
|
||||
{ImGuiKey_KeypadSubtract, "KeypadMinus", nullptr},
|
||||
{ImGuiKey_KeypadAdd, "KeypadPlus", nullptr},
|
||||
{ImGuiKey_KeypadEnter, "KeypadReturn", nullptr},
|
||||
{ImGuiKey_KeypadEqual, "KeypadEqual", nullptr}};
|
||||
|
||||
s_state.imgui_key_map.clear();
|
||||
for (const KeyMapping& km : mapping)
|
||||
|
Loading…
x
Reference in New Issue
Block a user