Minor issues when navigating using the keyboard #5759

Open
opened 2022-10-07 09:08:11 +00:00 by aybe · 4 comments
aybe commented 2022-10-07 09:08:11 +00:00 (Migrated from github.com)

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.

**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 commented 2023-03-09 14:30:36 +00:00 (Migrated from github.com)

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 :)

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 commented 2023-03-10 09:24:29 +00:00 (Migrated from github.com)

Amazing, thank you :)

Amazing, thank you :)
ocornut commented 2023-03-10 17:47:26 +00:00 (Migrated from github.com)

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.
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. - [X] Problem 3: From end-user perspective, shouldn't Color be also editable by the same key that FrameBounding is? - [X] Problem 4: Navigating with Tab key is not on par compared to arrow keys. - [X] 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.
aybe commented 2023-03-12 11:10:59 +00:00 (Migrated from github.com)

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! 🎯

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](https://github.com/aybe/DearImGui) 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](https://user-images.githubusercontent.com/1537591/224540561-a629256c-586a-4aa7-82d4-6e1b17f26462.png) Looking forward for the next big release, thanks! 🎯
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ocornut/imgui#5759
No description provided.