mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-11-03 22:51:06 +01:00 
			
		
		
		
	Nav: Added ImGuiNavInput_KeyMenu aside from ImGuiNavInput_PadMenu as it is one differenciator between pad and keyboard that's very annoying with the keyboard.
Remove the move/resize behavior that appears than holding the button for a while. (#787)
This commit is contained in:
		@@ -2665,7 +2665,7 @@ static ImVec2 GetNavInputAmount2d(int stick_no, ImGuiNavReadMode mode, float slo
 | 
				
			|||||||
static void ImGui::NavUpdateWindowing()
 | 
					static void ImGui::NavUpdateWindowing()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    ImGuiContext& g = *GImGui;
 | 
					    ImGuiContext& g = *GImGui;
 | 
				
			||||||
    if (!g.NavWindowingTarget && IsNavInputPressed(ImGuiNavInput_PadMenu, ImGuiNavReadMode_Pressed))
 | 
					    if (!g.NavWindowingTarget && (IsNavInputPressed(ImGuiNavInput_PadMenu, ImGuiNavReadMode_Pressed) || IsNavInputPressed(ImGuiNavInput_KeyMenu, ImGuiNavReadMode_Pressed)))
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        ImGuiWindow* window = g.NavWindow;
 | 
					        ImGuiWindow* window = g.NavWindow;
 | 
				
			||||||
        if (!window)
 | 
					        if (!window)
 | 
				
			||||||
@@ -2710,7 +2710,7 @@ static void ImGui::NavUpdateWindowing()
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (!IsNavInputDown(ImGuiNavInput_PadMenu))
 | 
					        if (!IsNavInputDown(ImGuiNavInput_PadMenu) && !IsNavInputDown(ImGuiNavInput_KeyMenu))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            // Apply actual focus only when releasing the NavMenu button (until then the window was merely rendered front-most)
 | 
					            // Apply actual focus only when releasing the NavMenu button (until then the window was merely rendered front-most)
 | 
				
			||||||
            if (g.NavWindowingTarget && !g.NavWindowingToggleLayer && (!g.NavWindow || g.NavWindowingTarget != g.NavWindow->RootNonPopupWindow))
 | 
					            if (g.NavWindowingTarget && !g.NavWindowingToggleLayer && (!g.NavWindow || g.NavWindowingTarget != g.NavWindow->RootNonPopupWindow))
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										1
									
								
								imgui.h
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								imgui.h
									
									
									
									
									
								
							@@ -640,6 +640,7 @@ enum ImGuiNavInput_
 | 
				
			|||||||
    ImGuiNavInput_PadFocusNext,     // prev window (with PadMenu held)              // e.g. R-trigger
 | 
					    ImGuiNavInput_PadFocusNext,     // prev window (with PadMenu held)              // e.g. R-trigger
 | 
				
			||||||
    ImGuiNavInput_PadTweakSlow,     // slower tweaks                                // e.g. L-trigger, analog
 | 
					    ImGuiNavInput_PadTweakSlow,     // slower tweaks                                // e.g. L-trigger, analog
 | 
				
			||||||
    ImGuiNavInput_PadTweakFast,     // faster tweaks                                // e.g. R-trigger, analog
 | 
					    ImGuiNavInput_PadTweakFast,     // faster tweaks                                // e.g. R-trigger, analog
 | 
				
			||||||
 | 
					    ImGuiNavInput_KeyMenu,          // access menu                                  // e.g. ALT
 | 
				
			||||||
    ImGuiNavInput_COUNT,
 | 
					    ImGuiNavInput_COUNT,
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user