MCPcopy Create free account
hub / github.com/Wemino/EchoPatch / NavUpdateContextMenuRequest

Method NavUpdateContextMenuRequest

include/imgui/imgui.cpp:14251–14274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14249}
14250
14251static void ImGui::NavUpdateContextMenuRequest()
14252{
14253 ImGuiContext& g = *GImGui;
14254 g.NavOpenContextMenuItemId = g.NavOpenContextMenuWindowId = 0;
14255 const bool nav_keyboard_active = (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) != 0;
14256 const bool nav_gamepad_active = (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) != 0;
14257 if ((!nav_keyboard_active && !nav_gamepad_active) || g.NavWindow == NULL)
14258 return;
14259
14260 bool request = false;
14261 request |= nav_keyboard_active && (IsKeyReleased(ImGuiKey_Menu, ImGuiKeyOwner_NoOwner) || (IsKeyPressed(ImGuiKey_F10, ImGuiInputFlags_None, ImGuiKeyOwner_NoOwner) && g.IO.KeyMods == ImGuiMod_Shift));
14262 request |= nav_gamepad_active && IsKeyPressed(ImGuiKey_NavGamepadContextMenu, ImGuiInputFlags_None, ImGuiKeyOwner_NoOwner);
14263 if (!request)
14264 return;
14265 g.NavOpenContextMenuItemId = g.NavId;
14266 g.NavOpenContextMenuWindowId = g.NavWindow->ID;
14267
14268 // Allow triggering for Begin()..BeginPopupContextItem(). A possible alternative would be to use g.NavLayer == ImGuiNavLayer_Menu.
14269 if (g.NavId == g.NavWindow->GetID("#CLOSE") || g.NavId == g.NavWindow->GetID("#COLLAPSE"))
14270 g.NavOpenContextMenuItemId = g.NavWindow->MoveId;
14271
14272 g.NavInputSource = ImGuiInputSource_Keyboard;
14273 SetNavCursorVisibleAfterMove();
14274}
14275
14276// Handle PageUp/PageDown/Home/End keys
14277// Called from NavUpdateCreateMoveRequest() which will use our output to create a move request

Callers

nothing calls this directly

Calls 1

GetIDMethod · 0.80

Tested by

no test coverage detected