mirror of
https://github.com/ocornut/imgui.git
synced 2026-10-29 07:54:40 +00:00
Keyboard navigation scoring logic has a bias to minimize horizontal distance #9580
Labels
No labels
accidentally closed
android
backends
bug
building
clipper
coloredit
color spaces
cplusplus
data types
demo
disabled
doc
docking
dpi
drag drop
drawing/drawlist
dropped
dx12
enhancement
focus
font/text
gallery
help wanted
idle/power saving
ime
in progress
inputs
inputtext
internals
label/id and id stack
language bindings
layout
linux/bsd
menus
multi-contexts
multi-threading
multi-viewports
nav
news/info
opengl
optimization
osx/ios
overlap
plot/graph
popups
question
scrolling
selection
settings
sliders/drags
style
tables/columns
tabs
test wanted
tools
tooltips
tree
tricks & tips
useful widgets
vulkan
web
window pos/depth
window sizing
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ocornut/imgui#9580
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Version/Branch of Dear ImGui:
Version 1.93.0 WIP, Branch: docking
Back-ends:
imgui_impl_win32.cpp + imgui_impl_dx11.cpp
Compiler, OS:
Windows 10 + MSVC 2026
Full config/build information:
Details:
Hello, I am working on a asset picker/popup for my unreal plugin and running into some weird issues when using keyboard navigations.
The way the interaction is supposed to work is that
However due to how the Nav scoring works it is picking the wrong widget for navigation.
https://github.com/user-attachments/assets/97b98d18-208b-4424-a450-a19656664ec3
Since the setup currently compares distances b/w rect centers it tends to penalize bigger sized items.
It prioritizes the side buttons over the list view (minimal repro shows it better, without any Unreal theme/style)
Any chance we could try to compare the edge distances instead of center?
I tried with a very HACKY setup and it seems to work better but I am sure there would be other edge cases
I can try using shortcuts API as a workaround but I really don't want to xD
Are there any other ways to solve this? Should I use child windows instead of groups?
Screenshots/Video:
https://github.com/user-attachments/assets/c013da37-83a9-4c02-b393-082e3d727fcd
Here ListBox is getting a higher score due to its height(size).
Minimal, Complete and Verifiable Example code:
The problem is proving the effect of changes on many cases/setups.
At minimum it would need adding more cases to test_suite before we can tackle scoring issues.
I'm certain there are other open issues related to Nav scoring and the effect of this X bias.