From 28c0b6986343f95cda98745b65028c838aba7fd9 Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Mon, 24 Feb 2025 06:08:22 +0000 Subject: [PATCH] Tab to toggle focus between addresses and scratchpad --- CHANGELOG.md | 6 +++--- src/gui/window.c | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69eb8cc..1ab6aa1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,13 +7,13 @@ - Type process name - Press Enter, select with Arrows, press Enter - Ctrl+F to focus Value field, type search Value - - Use Tab and Arrows to navigate and configure other options + - Use Arrows to navigate and configure other options - Ctrl+Enter to search - Ctrl+Space to stop Search, Ctrl+Z to undo/reset search - - Ctrl+A to focus Addresses list + - Ctrl+A or Tab to focus Addresses list - Arrows to navigate Addresses, Shift to select multiple - Enter to add to Scratchpad - - Ctrl+S to focus Scratchpad + - Ctrl+S or Tab to focus Scratchpad - Arrows to navigate Scratchpad, Shift to select multiple - Enter to set value - Delete to remove from Scratchpad diff --git a/src/gui/window.c b/src/gui/window.c index 8dabbf3..3df11dc 100644 --- a/src/gui/window.c +++ b/src/gui/window.c @@ -482,7 +482,9 @@ static void gui_window_draw_addresses_pane(Gui* gui, ImVec2 size) { if(clip_i == last_focused) { if(ImGui_Shortcut( ImGuiMod_Ctrl | ImGuiKey_A, - ImGuiInputFlags_RouteGlobal)) { + ImGuiInputFlags_RouteGlobal) || + (!ImGui_IsWindowFocused(ImGuiFocusedFlags_None) && + ImGui_Shortcut(ImGuiKey_Tab, ImGuiInputFlags_RouteGlobal))) { ImGui_SetKeyboardFocusHere(); ImGui_SetNavCursorVisible(true); } @@ -1079,7 +1081,9 @@ static void gui_window_draw_scratchpad_pane(Gui* gui, ImVec2 size) { if(clip_i == last_focused) { if(ImGui_Shortcut( ImGuiMod_Ctrl | ImGuiKey_S, - ImGuiInputFlags_RouteGlobal)) { + ImGuiInputFlags_RouteGlobal) || + (!ImGui_IsWindowFocused(ImGuiFocusedFlags_None) && + ImGui_Shortcut(ImGuiKey_Tab, ImGuiInputFlags_RouteGlobal))) { ImGui_SetKeyboardFocusHere(); ImGui_SetNavCursorVisible(true); }