MCPcopy Create free account
hub / github.com/bulletphysics/bullet3 / FocusableItemRegister

Method FocusableItemRegister

examples/ThirdPartyLibs/imgui/imgui.cpp:2596–2619  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2594}
2595
2596bool ImGui::FocusableItemRegister(ImGuiWindow* window, ImGuiID id, bool tab_stop)
2597{
2598 ImGuiContext& g = *GImGui;
2599
2600 const bool allow_keyboard_focus = (window->DC.ItemFlags & (ImGuiItemFlags_AllowKeyboardFocus | ImGuiItemFlags_Disabled)) == ImGuiItemFlags_AllowKeyboardFocus;
2601 window->FocusIdxAllCounter++;
2602 if (allow_keyboard_focus)
2603 window->FocusIdxTabCounter++;
2604
2605 // Process keyboard input at this point: TAB/Shift-TAB to tab out of the currently focused item.
2606 // Note that we can always TAB out of a widget that doesn't allow tabbing in.
2607 if (tab_stop && (g.ActiveId == id) && window->FocusIdxAllRequestNext == INT_MAX && window->FocusIdxTabRequestNext == INT_MAX && !g.IO.KeyCtrl && IsKeyPressedMap(ImGuiKey_Tab))
2608 window->FocusIdxTabRequestNext = window->FocusIdxTabCounter + (g.IO.KeyShift ? (allow_keyboard_focus ? -1 : 0) : +1); // Modulo on index will be applied at the end of frame once we've got the total counter of items.
2609
2610 if (window->FocusIdxAllCounter == window->FocusIdxAllRequestCurrent)
2611 return true;
2612 if (allow_keyboard_focus && window->FocusIdxTabCounter == window->FocusIdxTabRequestCurrent)
2613 {
2614 g.NavJustTabbedId = id;
2615 return true;
2616 }
2617
2618 return false;
2619}
2620
2621void ImGui::FocusableItemUnregister(ImGuiWindow* window)
2622{

Callers

nothing calls this directly

Calls 1

IsKeyPressedMapFunction · 0.85

Tested by

no test coverage detected