Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor issues when navigating using the keyboard #5759

Open
aybe opened this issue Oct 7, 2022 · 4 comments
Open

Minor issues when navigating using the keyboard #5759

aybe opened this issue Oct 7, 2022 · 4 comments
Labels
nav keyboard/gamepad navigation

Comments

@aybe
Copy link

aybe commented Oct 7, 2022

Config/Build Information:

Dear ImGui 1.89 WIP (18829)
--------------------------------
sizeof(size_t): 4, sizeof(ImDrawIdx): 2, sizeof(ImDrawVert): 20
define: __cplusplus=199711
define: _WIN32
define: _MSC_VER=1933
define: _MSVC_LANG=201402
--------------------------------
io.BackendPlatformName: imgui_impl_glfw
io.BackendRendererName: imgui_impl_opengl3
io.ConfigFlags: 0x00000001
 NavEnableKeyboard
io.ConfigInputTextCursorBlink
io.ConfigWindowsResizeFromEdges
io.ConfigMemoryCompactTimer = 60.0
io.BackendFlags: 0x00000006
 HasMouseCursors
 HasSetMousePos
--------------------------------
io.Fonts: 1 fonts, Flags: 0x00000000, TexSize: 512,64
io.DisplaySize: 1280.00,720.00
io.DisplayFramebufferScale: 1.00,1.00
--------------------------------
style.WindowPadding: 8.00,8.00
style.WindowBorderSize: 1.00
style.FramePadding: 4.00,3.00
style.FrameRounding: 0.00
style.FrameBorderSize: 0.00
style.ItemSpacing: 8.00,4.00
style.ItemInnerSpacing: 4.00,4.00

Version/Branch of Dear ImGui:
Version: 1.89 WIP
Branch: master

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_glfw.cpp + imgui_impl_opengl3.cpp
Compiler: Visual Studio 2022
Operating System: Windows 10

My Issue/Question:

Correct me if I'm wrong, but there appears to be a few bugs when it comes to navigating with the keyboard.

Start the example in imgui\examples\example_glfw_opengl3.

In the demo window, set NavEnableKeyboard to true.

Then start the style editor.

Problem 1:

The Colors dropdown is not initially selected, you must navigate at least once with the arrows:

  • if you press up, it will get selected though that's quite unintuitive.
  • if you press down, focus will go to Fonts right below it, forcing one to press up arrow to actually select it.

Problem 2:

If Colors is current keyboard navigation target, use the mouse to edit the value.

Once you've selected a new choice, the keyboard navigation adorner disappears.

However, the navigation is not broken, try use the arrows and it will navigate properly to another target.

Also, you can see its background highlighted, but as soon as you move the mouse, that highlighting disappears.

Problem 3:

If you compare the way you edit Colors and FrameRounding:

  • Colors can be edited by pressing space bar
  • FrameBounding can be edited by pressing enter key

From end-user perspective, shouldn't Color be also editable by the same key that FrameBounding is?

Problem 4:

Navigating with Tab key is not on par compared to arrow keys.

It only navigates to editable fields, never navigates to buttons and tabs present in the window.

On the other hand, navigating with the arrows works perfectly and allows to visit any control.

Problem 5:

Navigate to WindowPadding X with the keyboard, press Tab to navigate to the next field which is WindowPadding Y, it navigates to FrameRounding instead.

Problem 6:

If you switch windows with Ctrl-Tab back and forth, the keyboard navigation adorner is restored.

But if you use the mouse to click to another window and click back the window again, the adorner is gone, trying to set ConfigWindowsMoreFromTitleBarOnly to try mitigate this doesn't really help.

@ocornut ocornut added the nav keyboard/gamepad navigation label Oct 21, 2022
@ocornut
Copy link
Owner

ocornut commented Mar 9, 2023

Not answering Problem 1 & 2 & 6 just yet, they are related and there's no simple answer but we should rework things and offer more options.

Problem 3: If you compare the way you edit Colors and FrameRounding:
Colors can be edited by pressing space bar
FrameBounding can be edited by pressing enter key
From end-user perspective, shouldn't Color be also editable by the same key that FrameBounding is?

This has now been fixed (see #5606).

Problem 4: Navigating with Tab key is not on par compared to arrow keys.

This is #3092 and I am hoping to address it soon.

Problem 5:
Navigate to WindowPadding X with the keyboard, press Tab to navigate to the next field which is WindowPadding Y, it navigates to FrameRounding instead.

I agree it seems like a bug, it is indeed a subset of #3092. I'll just go work on it instead of trying to elaborate on what is happening here :)

@aybe
Copy link
Author

aybe commented Mar 10, 2023

Amazing, thank you :)

ocornut added a commit that referenced this issue Mar 10, 2023
@ocornut
Copy link
Owner

ocornut commented Mar 10, 2023

Problem 4 and Problem 5 (tabbing) should now be fixed.

What's left are 1,2,6 which are similar things to hopefully be addressed by 1.90.

  • Problem 1: The Colors dropdown is not initially selected, you must navigate at least once with the arrows:
  • Problem 2: Once you've selected a new choice, the keyboard navigation adorner disappears.
  • Problem 3: From end-user perspective, shouldn't Color be also editable by the same key that FrameBounding is?
  • Problem 4: Navigating with Tab key is not on par compared to arrow keys.
  • Problem 5: Navigate to WindowPadding X with the keyboard, press Tab to navigate to the next field which is WindowPadding Y,
  • Problem 6: But if you use the mouse to click to another window and click back the window again.

@ocornut ocornut added this to the v1.90 milestone Mar 10, 2023
@aybe
Copy link
Author

aybe commented Mar 12, 2023

Alright, I'll wait for v1.90 then!

Forgot to mention, since I posted that issue, I joined the dark side of the force; I wrote bindings for imgui if you haven't noticed it already on the wiki. 😀

It's been painful in the beginning but rewarding in the end, I've even been able to pull out imgui docs so they're immediately available so one does not have to juggle with headers. But these are still available one mouse click away. 😁

devenv_ZuqZzZ8b4Y

Looking forward for the next big release, thanks! 🎯

kjblanchard pushed a commit to kjblanchard/imgui that referenced this issue May 5, 2023
ocornut added a commit that referenced this issue Sep 11, 2023
…Enter key wouldn't be accepted by the widget when navigation highlight is visible. (#6802, #3092, #5759, #787)

+ Added test in ImGuiTestSuite: "widgets_inputtext_multiline_enter"
ocornut added a commit that referenced this issue Sep 11, 2023
@ocornut ocornut removed this from the v1.90 milestone Nov 15, 2023
ocornut added a commit that referenced this issue Dec 14, 2023
…GuiInputTextFlags_AllowTabInput doesn't activate it. (#3092, #5759, #787)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nav keyboard/gamepad navigation
Projects
None yet
Development

No branches or pull requests

2 participants