-
-
Notifications
You must be signed in to change notification settings - Fork 11.4k
Description
Version/Branch of Dear ImGui:
Version 1.92.2b
Back-ends:
Any (imgui_impl_sdl3.cpp + imgui_impl_sdlrenderer3.cpp)
Compiler, OS:
Any (MSVC + Win10)
Full config/build information:
No response
Details:
I have two related questions about ways to disable window-scrolling:
-
About
ctrlto disable scrolling:
Currently, pressing ctrl will disable window scrolling. This is intentionally handled in the codebase, and I want to rely on this behavior (to assume the window won't be scrolled when using ctrl+wheel to set some custom values).
Lines 10295 to 10296 in 960921f
if (g.IO.KeyCtrl) return;
However, in the same function there is a comment about obsoleteness, and I cannot make sure - does it only apply toFontAllowUserScaling, or does it also apply to the ctrl-to-disable-scrolling behavior?
Lines 10276 to 10278 in 960921f
// Zoom / Scale window // FIXME-OBSOLETE: This is an old feature, it still works but pretty much nobody is using it and may be best redesigned. if (wheel.y != 0.0f && g.IO.KeyCtrl && g.IO.FontAllowUserScaling) -
About custom way to disable scrolling:
I want to further disable window scrolling under some custom conditions (e.g. when certain buttons are pressed / certain popups displayed). Currently I'm usingImGui::SetKeyOwner(ImGuiKey_MouseWheelY, ImGuiKeyOwner_Any, ImGuiInputFlags_LockThisFrame), which seems to work. However (for easier maintenance) what's the recommended way to do this?
Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code:
No response