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

Method NavUpdateContextMenuRequest

include/imgui/imgui.cpp:14341–14364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14339}
14340
14341static void ImGui::NavUpdateContextMenuRequest()
14342{
14343 ImGuiContext& g = *GImGui;
14344 g.NavOpenContextMenuItemId = g.NavOpenContextMenuWindowId = 0;
14345 const bool nav_keyboard_active = (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) != 0;
14346 const bool nav_gamepad_active = (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) != 0;
14347 if ((!nav_keyboard_active && !nav_gamepad_active) || g.NavWindow == NULL)
14348 return;
14349
14350 bool request = false;
14351 request |= nav_keyboard_active && (IsKeyReleased(ImGuiKey_Menu, ImGuiKeyOwner_NoOwner) || (IsKeyPressed(ImGuiKey_F10, ImGuiInputFlags_None, ImGuiKeyOwner_NoOwner) && g.IO.KeyMods == ImGuiMod_Shift));
14352 request |= nav_gamepad_active && IsKeyPressed(ImGuiKey_NavGamepadContextMenu, ImGuiInputFlags_None, ImGuiKeyOwner_NoOwner);
14353 if (!request)
14354 return;
14355 g.NavOpenContextMenuItemId = g.NavId;
14356 g.NavOpenContextMenuWindowId = g.NavWindow->ID;
14357
14358 // Allow triggering for Begin()..BeginPopupContextItem(). A possible alternative would be to use g.NavLayer == ImGuiNavLayer_Menu.
14359 if (g.NavId == g.NavWindow->GetID("#CLOSE") || g.NavId == g.NavWindow->GetID("#COLLAPSE"))
14360 g.NavOpenContextMenuItemId = g.NavWindow->MoveId;
14361
14362 g.NavInputSource = ImGuiInputSource_Keyboard;
14363 SetNavCursorVisibleAfterMove();
14364}
14365
14366// Handle PageUp/PageDown/Home/End keys
14367// 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