From e4c099d67c653f03138b500554a5fba05abf1bc4 Mon Sep 17 00:00:00 2001 From: ocornut Date: Sat, 20 Aug 2016 22:11:00 +0200 Subject: [PATCH] Nav: Comments + fixed handling of PadLeft in menus (fix e55882f) (#323) --- imgui.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index a26dd9be9..98398001c 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -164,9 +164,10 @@ - query focus information with IsWindowFocused(), IsAnyWindowFocused(), IsAnyItemFocused() functions. The reality is more complex than what those flags can express. Please discuss your issues and usage scenario in the thread above. As we head toward more keyboard-oriented development this aspect will need to be improved. - - It is recommended that you enable the 'io.NavMovesMouse' option. Enabling it instructs ImGui that it can request moving your move cursor to track navigated items and ease readability. + - It is recommended that you enable the 'io.NavMovesMouse' option. Enabling it instructs ImGui that it can move your move cursor to track navigated items and ease readability. When enabled and using directional navigation (with d-pad or arrow keys), the NewFrame() functions may alter 'io.MousePos' and set 'io.WantMoveMouse' to notify you that it did so. - When that happens your back-end will need to move the OS mouse cursor on the next frame. The examples binding in examples/ do that. + When that happens your back-end NEEDS to move the OS or underlying mouse cursor on the next frame. The examples binding in examples/ do that. + (Important: It you set 'io.NavMovesMouse' to true but don't honor 'io.WantMoveMouse' properly, imgui will misbehave as it will think your mouse is moving back and forth.) // Application init io.NavMovesMouse = true; @@ -9794,7 +9795,7 @@ bool ImGui::BeginMenu(const char* label, bool enabled) want_open = true; g.NavMoveRequest = false; } - if (g.NavWindow && g.NavWindow->ParentWindow == window && g.NavMoveRequest && g.NavMoveDir == ImGuiNavDir_Left) // Nav-Left to close + if (g.NavWindow && g.NavWindow->ParentWindow == window && g.NavMoveRequest && g.NavMoveDir == ImGuiNavDir_Left && IsPopupOpen(id)) // Nav-Left to close { want_close = true; g.NavMoveRequest = false;