Lines Matching refs:IO
526 - 2015/02/01 (1.31) - removed IO.MemReallocFn (unused)
535 (1.30) - removed IO.PixelCenterOffset (unnecessary, can be handled in user projection matrix)
538 - 2014/11/28 (1.17) - moved IO.Font*** options to inside the IO.Font-> structure (FontYOffset, FontTexUvForWhite, FontBaseScale, FontFallbackGlyph)
542 - 2014/09/25 (1.13) - removed 'text_end' parameter from IO.SetClipboardTextFn (the string is now always zero-terminated for simplicity)
544 - 2014/09/24 (1.12) - moved IM_MALLOC/IM_REALLOC/IM_FREE preprocessor defines to IO.MemAllocFn/IO.MemReallocFn/IO.MemFreeFn
545 - 2014/08/30 (1.09) - removed IO.FontHeight (now computed automatically)
546 - 2014/08/30 (1.09) - moved IMGUI_FONT_TEX_UV_FOR_WHITE preprocessor define to IO.FontTexUvForWhite
547 - 2014/08/28 (1.09) - changed the behavior of IO.PixelCenterOffset following various rendering fixes
1009 // Platform Dependents default implementation for IO functions
2753 //if (g.IO.KeyAlt) window->DrawList->AddRect(window->DC.CursorPos, window->DC.CursorPos + ImVec2(size.x, line_height), IM_COL32(255,0,0,200)); // [DEBUG]
2759 //if (g.IO.KeyAlt) window->DrawList->AddCircle(window->DC.CursorMaxPos, 3.0f, IM_COL32(255,0,0,255), 4); // [DEBUG]
2810 //if (g.IO.KeyAlt) window->DrawList->AddRect(bb.Min, bb.Max, IM_COL32(255,255,0,120)); // [DEBUG]
2906 if (tab_stop && (g.ActiveId == id) && window->FocusIdxAllRequestNext == INT_MAX && window->FocusIdxTabRequestNext == INT_MAX && !g.IO.KeyCtrl && IsKeyPressedMap(ImGuiKey_Tab))
2907 window->FocusIdxTabRequestNext = window->FocusIdxTabCounter + (g.IO.KeyShift ? (is_tab_stop ? -1 : 0) : +1); // Modulo on index will be applied at the end of frame once we've got the total counter of items.
2956 ctx->IO.MetricsActiveAllocations++;
2964 ctx->IO.MetricsActiveAllocations--;
2970 return GImGui->IO.GetClipboardTextFn ? GImGui->IO.GetClipboardTextFn(GImGui->IO.ClipboardUserData) : "";
2975 if (GImGui->IO.SetClipboardTextFn)
2976 GImGui->IO.SetClipboardTextFn(GImGui->IO.ClipboardUserData, text);
3043 return GImGui->IO;
3094 g.ActiveIdClickOffset = g.IO.MousePos - window->RootWindow->Pos;
3115 if (g.IO.MouseDown[0] && IsMousePosValid(&g.IO.MousePos))
3117 ImVec2 pos = g.IO.MousePos - g.ActiveIdClickOffset;
3137 if (!g.IO.MouseDown[0])
3156 if (g.IO.MouseClicked[0])
3161 if (g.IO.ConfigWindowsMoveFromTitleBarOnly && !(g.HoveredRootWindow->Flags & ImGuiWindowFlags_NoTitleBar))
3162 if (!g.HoveredRootWindow->TitleBarRect().Contains(g.IO.MouseClickedPos[0]))
3174 if (g.IO.MouseClicked[1])
3204 if (IsMousePosValid(&g.IO.MousePos))
3205 g.IO.MousePos = g.LastValidMousePos = ImFloor(g.IO.MousePos);
3208 if (IsMousePosValid(&g.IO.MousePos) && IsMousePosValid(&g.IO.MousePosPrev))
3209 g.IO.MouseDelta = g.IO.MousePos - g.IO.MousePosPrev;
3211 g.IO.MouseDelta = ImVec2(0.0f, 0.0f);
3212 if (g.IO.MouseDelta.x != 0.0f || g.IO.MouseDelta.y != 0.0f)
3215 g.IO.MousePosPrev = g.IO.MousePos;
3216 for (int i = 0; i < IM_ARRAYSIZE(g.IO.MouseDown); i++)
3218 g.IO.MouseClicked[i] = g.IO.MouseDown[i] && g.IO.MouseDownDuration[i] < 0.0f;
3219 g.IO.MouseReleased[i] = !g.IO.MouseDown[i] && g.IO.MouseDownDuration[i] >= 0.0f;
3220 g.IO.MouseDownDurationPrev[i] = g.IO.MouseDownDuration[i];
3221 g.IO.MouseDownDuration[i] = g.IO.MouseDown[i] ? (g.IO.MouseDownDuration[i] < 0.0f ? 0.0f : g.IO.MouseDownDuration[i] + g.IO.DeltaTime) : -1.0f;
3222 g.IO.MouseDoubleClicked[i] = false;
3223 if (g.IO.MouseClicked[i])
3225 if ((float)(g.Time - g.IO.MouseClickedTime[i]) < g.IO.MouseDoubleClickTime)
3227 ImVec2 delta_from_click_pos = IsMousePosValid(&g.IO.MousePos) ? (g.IO.MousePos - g.IO.MouseClickedPos[i]) : ImVec2(0.0f, 0.0f);
3228 if (ImLengthSqr(delta_from_click_pos) < g.IO.MouseDoubleClickMaxDist * g.IO.MouseDoubleClickMaxDist)
3229 g.IO.MouseDoubleClicked[i] = true;
3230 g.IO.MouseClickedTime[i] = -FLT_MAX; // so the third click isn't turned into a double-click
3234 g.IO.MouseClickedTime[i] = g.Time;
3236 g.IO.MouseClickedPos[i] = g.IO.MousePos;
3237 g.IO.MouseDragMaxDistanceAbs[i] = ImVec2(0.0f, 0.0f);
3238 g.IO.MouseDragMaxDistanceSqr[i] = 0.0f;
3240 else if (g.IO.MouseDown[i])
3243 ImVec2 delta_from_click_pos = IsMousePosValid(&g.IO.MousePos) ? (g.IO.MousePos - g.IO.MouseClickedPos[i]) : ImVec2(0.0f, 0.0f);
3244 g.IO.MouseDragMaxDistanceSqr[i] = ImMax(g.IO.MouseDragMaxDistanceSqr[i], ImLengthSqr(delta_from_click_pos));
3245 g.IO.MouseDragMaxDistanceAbs[i].x = ImMax(g.IO.MouseDragMaxDistanceAbs[i].x, delta_from_click_pos.x < 0.0f ? -delta_from_click_pos.x : delta_from_click_pos.x);
3246 g.IO.MouseDragMaxDistanceAbs[i].y = ImMax(g.IO.MouseDragMaxDistanceAbs[i].y, delta_from_click_pos.y < 0.0f ? -delta_from_click_pos.y : delta_from_click_pos.y);
3248 if (g.IO.MouseClicked[i]) // Clicking any mouse button reactivate mouse hovering which may have been deactivated by gamepad/keyboard navigation
3258 if (g.IO.MouseWheel == 0.0f && g.IO.MouseWheelH == 0.0f)
3268 if (g.IO.MouseWheel != 0.0f)
3270 if (g.IO.KeyCtrl && g.IO.FontAllowUserScaling)
3273 const float new_font_scale = ImClamp(window->FontWindowScale + g.IO.MouseWheel * 0.10f, 0.50f, 2.50f);
3277 const ImVec2 offset = window->Size * (1.0f - scale) * (g.IO.MousePos - window->Pos) / window->Size;
3282 else if (!g.IO.KeyCtrl && scroll_allowed)
3287 SetWindowScrollY(scroll_window, scroll_window->Scroll.y - g.IO.MouseWheel * scroll_amount);
3290 if (g.IO.MouseWheelH != 0.0f && scroll_allowed && !g.IO.KeyCtrl)
3294 SetWindowScrollX(scroll_window, scroll_window->Scroll.x - g.IO.MouseWheelH * scroll_amount);
3316 if (g.IO.ConfigFlags & ImGuiConfigFlags_NoMouse)
3322 for (int i = 0; i < IM_ARRAYSIZE(g.IO.MouseDown); i++)
3324 if (g.IO.MouseClicked[i])
3325 g.IO.MouseDownOwned[i] = (g.HoveredWindow != NULL) || (!g.OpenPopupStack.empty());
3326 mouse_any_down |= g.IO.MouseDown[i];
3327 if (g.IO.MouseDown[i])
3328 if (mouse_earliest_button_down == -1 || g.IO.MouseClickedTime[i] < g.IO.MouseClickedTime[mouse_earliest_button_down])
3331 const bool mouse_avail_to_imgui = (mouse_earliest_button_down == -1) || g.IO.MouseDownOwned[mouse_earliest_button_down];
3341 g.IO.WantCaptureMouse = (g.WantCaptureMouseNextFrame != 0);
3343 g.IO.WantCaptureMouse = (mouse_avail_to_imgui && (g.HoveredWindow != NULL || mouse_any_down)) || (!g.OpenPopupStack.empty());
3347 g.IO.WantCaptureKeyboard = (g.WantCaptureKeyboardNextFrame != 0);
3349 g.IO.WantCaptureKeyboard = (g.ActiveId != 0) || (modal_window != NULL);
3350 if (g.IO.NavActive && (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) && !(g.IO.ConfigFlags & ImGuiConfigFlags_NavNoCaptureKeyboard))
3351 g.IO.WantCaptureKeyboard = true;
3354 g.IO.WantTextInput = (g.WantTextInputNextFrame != -1) ? (g.WantTextInputNextFrame != 0) : false;
3369 IM_ASSERT((g.IO.DeltaTime > 0.0f || g.FrameCount == 0) && "Need a positive DeltaTime!");
3370 IM_ASSERT(g.IO.DisplaySize.x >= 0.0f && g.IO.DisplaySize.y >= 0.0f && "Invalid DisplaySize value!");
3371 IM_ASSERT(g.IO.Fonts->Fonts.Size > 0 && "Font Atlas not built. Did you call io.Fonts->GetTexDataAsRGBA32() / GetTexDataAsAlpha8() ?");
3372 IM_ASSERT(g.IO.Fonts->Fonts[0]->IsLoaded() && "Font Atlas not built. Did you call io.Fonts->GetTexDataAsRGBA32() / GetTexDataAsAlpha8() ?");
3377 IM_ASSERT(g.IO.KeyMap[n] >= -1 && g.IO.KeyMap[n] < IM_ARRAYSIZE(g.IO.KeysDown) && "io.KeyMap[] contains an out of bound value (need to be 0..512, or -1 for unmapped key)");
3380 if (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard)
3381 IM_ASSERT(g.IO.KeyMap[ImGuiKey_Space] != -1 && "ImGuiKey_Space is not mapped, required for keyboard navigation.");
3384 if (g.IO.ConfigWindowsResizeFromEdges && !(g.IO.BackendFlags & ImGuiBackendFlags_HasMouseCursors))
3385 g.IO.ConfigWindowsResizeFromEdges = false;
3391 if (g.IO.IniFilename)
3392 LoadIniSettingsFromDisk(g.IO.IniFilename);
3399 g.SettingsDirtyTimer -= g.IO.DeltaTime;
3402 if (g.IO.IniFilename != NULL)
3403 SaveIniSettingsToDisk(g.IO.IniFilename);
3405 g.IO.WantSaveIniSettings = true; // Let user know they can call SaveIniSettingsToMemory(). user will need to clear io.WantSaveIniSettings themselves.
3410 g.Time += g.IO.DeltaTime;
3417 g.IO.Fonts->Locked = true;
3420 g.DrawListSharedData.ClipRectFullscreen = ImVec4(0.0f, 0.0f, g.IO.DisplaySize.x, g.IO.DisplaySize.y);
3424 g.OverlayDrawList.PushTextureID(g.IO.Fonts->TexID);
3441 g.HoveredIdTimer += g.IO.DeltaTime;
3443 g.HoveredIdNotActiveTimer += g.IO.DeltaTime;
3450 g.ActiveIdTimer += g.IO.DeltaTime;
3451 g.LastActiveIdTimer += g.IO.DeltaTime;
3468 memcpy(g.IO.KeysDownDurationPrev, g.IO.KeysDownDuration, sizeof(g.IO.KeysDownDuration));
3469 for (int i = 0; i < IM_ARRAYSIZE(g.IO.KeysDown); i++)
3470 g.IO.KeysDownDuration[i] = g.IO.KeysDown[i] ? (g.IO.KeysDownDuration[i] < 0.0f ? 0.0f : g.IO.KeysDownDuration[i] + g.IO.DeltaTime) : -1.0f;
3479 g.FramerateSecPerFrameAccum += g.IO.DeltaTime - g.FramerateSecPerFrame[g.FramerateSecPerFrameIdx];
3480 g.FramerateSecPerFrame[g.FramerateSecPerFrameIdx] = g.IO.DeltaTime;
3482 g.IO.Framerate = (g.FramerateSecPerFrameAccum > 0.0f) ? (1.0f / (g.FramerateSecPerFrameAccum / (float)IM_ARRAYSIZE(g.FramerateSecPerFrame))) : FLT_MAX;
3490 g.DimBgRatio = ImMin(g.DimBgRatio + g.IO.DeltaTime * 6.0f, 1.0f);
3492 g.DimBgRatio = ImMax(g.DimBgRatio - g.IO.DeltaTime * 10.0f, 0.0f);
3502 if (g.ActiveId == 0 && g.NavWindow != NULL && g.NavWindow->Active && !(g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs) && !g.IO.KeyCtrl && IsKeyPressedMap(ImGuiKey_Tab, false))
3505 g.NavWindow->FocusIdxTabRequestNext = g.NavIdTabCounter + 1 + (g.IO.KeyShift ? -1 : 1);
3507 g.NavWindow->FocusIdxTabRequestNext = g.IO.KeyShift ? -1 : 0;
3565 if (g.IO.Fonts && g.FontAtlasOwnedByContext)
3567 g.IO.Fonts->Locked = false;
3568 IM_DELETE(g.IO.Fonts);
3570 g.IO.Fonts = NULL;
3577 if (g.SettingsLoaded && g.IO.IniFilename != NULL)
3581 SaveIniSettingsToDisk(g.IO.IniFilename);
3690 g.IO.MetricsRenderWindows++;
3769 if (g.IO.ImeSetInputScreenPosFn && (g.PlatformImeLastPos.x == FLT_MAX || ImLengthSqr(g.PlatformImeLastPos - g.PlatformImePos) > 0.0001f))
3771 g.IO.ImeSetInputScreenPosFn((int)g.PlatformImePos.x, (int)g.PlatformImePos.y);
3840 g.IO.MetricsActiveWindows = g.WindowsActiveCount;
3843 g.IO.Fonts->Locked = false;
3846 g.IO.MouseWheel = g.IO.MouseWheelH = 0.0f;
3847 g.IO.InputQueueCharacters.resize(0);
3848 memset(g.IO.NavInputs, 0, sizeof(g.IO.NavInputs));
3861 g.IO.MetricsRenderVertices = g.IO.MetricsRenderIndices = g.IO.MetricsRenderWindows = 0;
3878 if (g.IO.MouseDrawCursor)
3879 RenderMouseCursor(&g.OverlayDrawList, g.IO.MousePos, g.Style.MouseCursorScale, g.MouseCursor);
3886 g.IO.MetricsRenderVertices = g.DrawData.TotalVtxCount;
3887 g.IO.MetricsRenderIndices = g.DrawData.TotalIdxCount;
3891 if (g.DrawData.CmdListsCount > 0 && g.IO.RenderDrawListsFn != NULL)
3892 g.IO.RenderDrawListsFn(&g.DrawData);
3974 ImVec2 padding_for_resize_from_edges = g.IO.ConfigWindowsResizeFromEdges ? ImMax(g.Style.TouchExtraPadding, ImVec2(WINDOWS_RESIZE_FROM_EDGES_HALF_THICKNESS, WINDOWS_RESIZE_FROM_EDGES_HALF_THICKNESS)) : padding_regular;
3989 if (!bb.Contains(g.IO.MousePos))
4018 if (!rect_for_touch.Contains(g.IO.MousePos))
4026 return GImGui->IO.KeyMap[imgui_key];
4033 IM_ASSERT(user_key_index >= 0 && user_key_index < IM_ARRAYSIZE(GImGui->IO.KeysDown));
4034 return GImGui->IO.KeysDown[user_key_index];
4052 IM_ASSERT(key_index >= 0 && key_index < IM_ARRAYSIZE(g.IO.KeysDown));
4053 const float t = g.IO.KeysDownDuration[key_index];
4054 return CalcTypematicPressedRepeatAmount(t, t - g.IO.DeltaTime, repeat_delay, repeat_rate);
4062 IM_ASSERT(user_key_index >= 0 && user_key_index < IM_ARRAYSIZE(g.IO.KeysDown));
4063 const float t = g.IO.KeysDownDuration[user_key_index];
4066 if (repeat && t > g.IO.KeyRepeatDelay)
4067 return GetKeyPressedAmount(user_key_index, g.IO.KeyRepeatDelay, g.IO.KeyRepeatRate) > 0;
4075 IM_ASSERT(user_key_index >= 0 && user_key_index < IM_ARRAYSIZE(g.IO.KeysDown));
4076 return g.IO.KeysDownDurationPrev[user_key_index] >= 0.0f && !g.IO.KeysDown[user_key_index];
4082 IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
4083 return g.IO.MouseDown[button];
4089 for (int n = 0; n < IM_ARRAYSIZE(g.IO.MouseDown); n++)
4090 if (g.IO.MouseDown[n])
4098 IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
4099 const float t = g.IO.MouseDownDuration[button];
4103 if (repeat && t > g.IO.KeyRepeatDelay)
4105 float delay = g.IO.KeyRepeatDelay, rate = g.IO.KeyRepeatRate;
4106 if ((ImFmod(t - delay, rate) > rate*0.5f) != (ImFmod(t - delay - g.IO.DeltaTime, rate) > rate*0.5f))
4116 IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
4117 return g.IO.MouseReleased[button];
4123 IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
4124 return g.IO.MouseDoubleClicked[button];
4130 IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
4131 if (!g.IO.MouseDown[button])
4134 lock_threshold = g.IO.MouseDragThreshold;
4135 return g.IO.MouseDragMaxDistanceSqr[button] >= lock_threshold * lock_threshold;
4140 return GImGui->IO.MousePos;
4149 return g.IO.MousePos;
4159 ImVec2 p = mouse_pos ? *mouse_pos : GImGui->IO.MousePos;
4169 IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
4171 lock_threshold = g.IO.MouseDragThreshold;
4172 if (g.IO.MouseDown[button])
4173 if (g.IO.MouseDragMaxDistanceSqr[button] >= lock_threshold * lock_threshold)
4174 return g.IO.MousePos - g.IO.MouseClickedPos[button]; // Assume we can only get active with left-mouse button (at the moment).
4181 IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
4182 // NB: We don't need to reset g.IO.MouseDragMaxDistanceSqr
4183 g.IO.MouseClickedPos[button] = g.IO.MousePos;
4318 return ImRect(0.0f, 0.0f, g.IO.DisplaySize.x, g.IO.DisplaySize.y);
4588 ImVec2 size_auto_fit = ImClamp(size_contents, size_min, ImMax(size_min, g.IO.DisplaySize - style.DisplaySafeAreaPadding * 2.0f));
4706 const int resize_border_count = g.IO.ConfigWindowsResizeFromEdges ? 4 : 0;
4709 const float grip_hover_outer_size = g.IO.ConfigWindowsResizeFromEdges ? WINDOWS_RESIZE_FROM_EDGES_HALF_THICKNESS : 0.0f;
4731 if (held && g.IO.MouseDoubleClicked[0] && resize_grip_n == 0)
4741 ImVec2 corner_target = g.IO.MousePos - g.ActiveIdClickOffset + ImLerp(grip.InnerDir * grip_hover_outer_size, grip.InnerDir * -grip_hover_inner_size, grip.CornerPosN); // Corner of the window corresponding to our corner grip
4763 if (border_n == 0) { border_posn = ImVec2(0, 0); border_target.y = (g.IO.MousePos.y - g.ActiveIdClickOffset.y + WINDOWS_RESIZE_FROM_EDGES_HALF_THICKNESS); } // Top
4764 if (border_n == 1) { border_posn = ImVec2(1, 0); border_target.x = (g.IO.MousePos.x - g.ActiveIdClickOffset.x + WINDOWS_RESIZE_FROM_EDGES_HALF_THICKNESS); } // Right
4765 if (border_n == 2) { border_posn = ImVec2(0, 1); border_target.y = (g.IO.MousePos.y - g.ActiveIdClickOffset.y + WINDOWS_RESIZE_FROM_EDGES_HALF_THICKNESS); } // Bottom
4766 if (border_n == 3) { border_posn = ImVec2(0, 0); border_target.x = (g.IO.MousePos.x - g.ActiveIdClickOffset.x + WINDOWS_RESIZE_FROM_EDGES_HALF_THICKNESS); } // Left
4776 if (g.NavInputSource == ImGuiInputSource_NavKeyboard && g.IO.KeyShift)
4783 nav_resize_delta *= ImFloor(NAV_RESIZE_SPEED * g.IO.DeltaTime * ImMin(g.IO.DisplayFramebufferScale.x, g.IO.DisplayFramebufferScale.y));
5047 if (g.HoveredWindow == window && g.HoveredId == 0 && g.HoveredIdPreviousFrame == 0 && IsMouseHoveringRect(title_bar_rect.Min, title_bar_rect.Max) && g.IO.MouseDoubleClicked[0])
5140 if (g.IO.DisplaySize.x > 0.0f && g.IO.DisplaySize.y > 0.0f) // Ignore zero-sized display explicitly to avoid losing positions if a window manager reports zero-sized window when initializing or minimizing.
5143 ImVec2 size_for_clamping = ((g.IO.ConfigWindowsMoveFromTitleBarOnly) && !(window->Flags & ImGuiWindowFlags_NoTitleBar)) ? ImVec2(window->Size.x, window->TitleBarHeight()) : window->Size;
5145 window->Pos = ImMin(window->Pos, g.IO.DisplaySize - padding);
5176 const int resize_grip_count = g.IO.ConfigWindowsResizeFromEdges ? 2 : 1; // 4
5424 if (g.IO.KeyCtrl && IsKeyPressedMap(ImGuiKey_C))
5676 g.FontBaseSize = ImMax(1.0f, g.IO.FontGlobalScale * g.Font->FontSize * g.Font->Scale);
6663 //ImVec2 tooltip_pos = g.IO.MousePos - g.ActiveIdClickOffset - g.Style.WindowPadding;
6664 ImVec2 tooltip_pos = g.IO.MousePos + ImVec2(16 * g.Style.MouseCursorScale, 8 * g.Style.MouseCursorScale);
6768 popup_ref.OpenMousePos = IsMousePosValid(&g.IO.MousePos) ? g.IO.MousePos : popup_ref.OpenPopupPos;
6952 SetNextWindowPos(g.IO.DisplaySize * 0.5f, ImGuiCond_Appearing, ImVec2(0.5f, 0.5f));
7105 if (!g.NavDisableHighlight && g.NavDisableMouseHover && !(g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos))
7229 draw_list->AddText(g.IO.FontDefault, 13.0f, cand.Max, ~0U, buf);
7231 else if (g.IO.KeyCtrl) // Hold to preview score in matching quadrant. Press C to rotate.
7233 if (ImGui::IsKeyPressedMap(ImGuiKey_C)) { g.NavMoveDirLast = (ImGuiDir)((g.NavMoveDirLast + 1) & 3); g.IO.KeysDownDuration[g.IO.KeyMap[ImGuiKey_C]] = 0.01f; }
7239 draw_list->AddText(g.IO.FontDefault, 13.0f, cand.Min, IM_COL32(255, 255, 255, 255), buf);
7294 //if (!g.IO.NavActive) // [2017/10/06] Removed this possibly redundant test but I am not sure of all the side-effects yet. Some of the feature here will need to work regardless of using a _NoNavInputs flag.
7486 if (IsMousePosValid(&g.IO.MousePos))
7487 return g.IO.MousePos;
7504 return g.IO.NavInputs[n]; // Instant, read analog input (0.0f..1.0f, as provided by user)
7506 const float t = g.IO.NavInputsDownDuration[n];
7508 return (g.IO.NavInputsDownDurationPrev[n] >= 0.0f ? 1.0f : 0.0f);
7514 return (float)CalcTypematicPressedRepeatAmount(t, t - g.IO.DeltaTime, g.IO.KeyRepeatDelay * 0.80f, g.IO.KeyRepeatRate * 0.80f);
7516 return (float)CalcTypematicPressedRepeatAmount(t, t - g.IO.DeltaTime, g.IO.KeyRepeatDelay * 1.00f, g.IO.KeyRepeatRate * 2.00f);
7518 return (float)CalcTypematicPressedRepeatAmount(t, t - g.IO.DeltaTime, g.IO.KeyRepeatDelay * 0.80f, g.IO.KeyRepeatRate * 0.30f);
7573 g.IO.WantSetMousePos = false;
7579 bool nav_keyboard_active = (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) != 0;
7580 bool nav_gamepad_active = (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) != 0 && (g.IO.BackendFlags & ImGuiBackendFlags_HasGamepad) != 0;
7582 if (g.IO.NavInputs[ImGuiNavInput_Activate] > 0.0f || g.IO.NavInputs[ImGuiNavInput_Input] > 0.0f || g.IO.NavInputs[ImGuiNavInput_Cancel] > 0.0f || g.IO.NavInputs[ImGuiNavInput_Menu] > 0.0f)
7588 #define NAV_MAP_KEY(_KEY, _NAV_INPUT) if (IsKeyDown(g.IO.KeyMap[_KEY])) { g.IO.NavInputs[_NAV_INPUT] = 1.0f; g.NavInputSource = ImGuiInputSource_NavKeyboard; }
7596 if (g.IO.KeyCtrl) g.IO.NavInputs[ImGuiNavInput_TweakSlow] = 1.0f;
7597 if (g.IO.KeyShift) g.IO.NavInputs[ImGuiNavInput_TweakFast] = 1.0f;
7598 if (g.IO.KeyAlt) g.IO.NavInputs[ImGuiNavInput_KeyMenu_] = 1.0f;
7601 memcpy(g.IO.NavInputsDownDurationPrev, g.IO.NavInputsDownDuration, sizeof(g.IO.NavInputsDownDuration));
7602 for (int i = 0; i < IM_ARRAYSIZE(g.IO.NavInputs); i++)
7603 g.IO.NavInputsDownDuration[i] = (g.IO.NavInputs[i] > 0.0f) ? (g.IO.NavInputsDownDuration[i] < 0.0f ? 0.0f : g.IO.NavInputsDownDuration[i] + g.IO.DeltaTime) : -1.0f;
7638 if ((g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) && (g.IO.BackendFlags & ImGuiBackendFlags_HasSetMousePos))
7642 g.IO.MousePos = g.IO.MousePosPrev = NavCalcPreferredRefPos();
7643 g.IO.WantSetMousePos = true;
7662 g.IO.NavActive = (nav_keyboard_active || nav_gamepad_active) && g.NavWindow && !(g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs);
7663 g.IO.NavVisible = (g.IO.NavActive && g.NavId != 0 && !g.NavDisableHighlight) || (g.NavWindowingTarget != NULL);
7779 const float scroll_speed = ImFloor(window->CalcFontSize() * 100 * g.IO.DeltaTime + 0.5f); // We need round the scrolling speed because sub-pixel scroll isn't reliably supported.
7901 bool page_up_held = IsKeyDown(g.IO.KeyMap[ImGuiKey_PageUp]) && (allowed_dir_flags & (1 << ImGuiDir_Up));
7902 bool page_down_held = IsKeyDown(g.IO.KeyMap[ImGuiKey_PageDown]) && (allowed_dir_flags & (1 << ImGuiDir_Down));
7908 if (IsKeyPressed(g.IO.KeyMap[ImGuiKey_PageUp], true))
7910 else if (IsKeyPressed(g.IO.KeyMap[ImGuiKey_PageDown], true))
7918 if (IsKeyPressed(g.IO.KeyMap[ImGuiKey_PageUp], true))
7925 else if (IsKeyPressed(g.IO.KeyMap[ImGuiKey_PageDown], true))
7990 g.NavWindowingHighlightAlpha = ImMax(g.NavWindowingHighlightAlpha - g.IO.DeltaTime * 10.0f, 0.0f);
7997 bool start_windowing_with_keyboard = !g.NavWindowingTarget && g.IO.KeyCtrl && IsKeyPressedMap(ImGuiKey_Tab) && (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard);
8008 g.NavWindowingTimer += g.IO.DeltaTime;
8040 NavUpdateWindowingHighlightWindow(g.IO.KeyShift ? +1 : -1);
8041 if (!g.IO.KeyCtrl)
8046 // FIXME: We lack an explicit IO variable for "is the imgui window focused", so compare mouse validity to detect the common case of back-end clearing releases all keys on ALT-TAB
8048 if (IsMousePosValid(&g.IO.MousePos) == IsMousePosValid(&g.IO.MousePosPrev))
8055 if (g.NavInputSource == ImGuiInputSource_NavKeyboard && !g.IO.KeyShift)
8062 const float move_speed = ImFloor(NAV_MOVE_SPEED * g.IO.DeltaTime * ImMin(g.IO.DisplayFramebufferScale.x, g.IO.DisplayFramebufferScale.y)); // FIXME: Doesn't code variable framerate very well
8129 SetNextWindowSizeConstraints(ImVec2(g.IO.DisplaySize.x * 0.20f, g.IO.DisplaySize.y * 0.20f), ImVec2(FLT_MAX, FLT_MAX));
8130 SetNextWindowPos(g.IO.DisplaySize * 0.5f, ImGuiCond_Always, ImVec2(0.5f, 0.5f));
8219 float x = g.IO.MousePos.x - g.ActiveIdClickOffset.x + GetColumnsRectHalfWidth() - window->Pos.x;
8504 if (g.IO.MouseDown[mouse_button] == false)
8527 if (is_hovered && g.IO.MouseClicked[mouse_button])
8858 filename = g.IO.LogFilename;
8935 LogToFile(g.LogAutoExpandMaxDepth, g.IO.LogFilename);
8948 g.SettingsDirtyTimer = g.IO.IniSavingRate;
8956 g.SettingsDirtyTimer = g.IO.IniSavingRate;
9257 if (HWND hwnd = (HWND)GImGui->IO.ImeWindowHandle)
9482 ImGui::Text("NavActive: %d, NavVisible: %d", g.IO.NavActive, g.IO.NavVisible);
9491 if (g.IO.KeyCtrl && show_window_begin_order)