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

Tabbing/Navigation over all kind of items using the Tab key #3092

Closed
JPGygax68 opened this issue Apr 1, 2020 · 7 comments
Closed

Tabbing/Navigation over all kind of items using the Tab key #3092

JPGygax68 opened this issue Apr 1, 2020 · 7 comments
Labels
focus nav keyboard/gamepad navigation
Milestone

Comments

@JPGygax68
Copy link

I cannot seem to navigate between my text field and my tree view (tree of TreeNode widgets) using the Tab key.

I can get to the text field (which is first child of my window) using Tab.
When I click on my text field, I can tab out of it, but the focus does not go to my tree.
When I click on any node of my tree, I can use the cursor keys to navigate and open/close nodes, but I cannot tab back to my text field.

The tree is wrapped into a BeginChild/EndChild group; the InputText widget is not.

Note: using cursor up/down, I can get a frame to display around either my text field or my tree; however, that seems to have no influence on the keyboard focus.

@ocornut ocornut added focus nav keyboard/gamepad navigation labels Apr 1, 2020
@ocornut
Copy link
Owner

ocornut commented Apr 1, 2020

Hello Hans-Peter,

Essentially none of the things you are (justly) suggesting are presently implemented.
The Tabbing system was implemented very early on (<1.00) and the keyboard/gamepad navigation system doesn't really uses it.

I had a large wip stash working on redesigning this but the feature set kinda grew (as I was working on an API to activate/focus item which requires solving more issues). I could perhaps try to get a simpler version of that in.

@JPGygax68
Copy link
Author

Thanks Omar! Whatever you can do will be welcome. I quite understand that focus management is far from trivial.

@slajerek
Copy link

slajerek commented Jun 16, 2021

Thanks for mentioning my issue. This is very serious blocker for me as my tool needs quick navigation using keyboard, that is quite a main requirement of my application. I was not even aware that is not currently possible when I started porting my code to ImGui... Anyway, good luck on getting this done!

@dbechrd
Copy link

dbechrd commented Oct 26, 2021

I was trying to design a simple modal with a textbox and an ok/cancel button and realized I couldn't tab from the textbox to the buttons. I pressed tab by second nature and didn't even consider it might not work. Though it's obvious in retrospect how annoying this could be to implement, it does seem fairly important for making polished UIs. Any workaround in the meantime?

@ocornut
Copy link
Owner

ocornut commented Oct 26, 2021

No workaround but I've put some very serious time last month in moving forward with tabbing and some aspect of navigation system. Quick recap.

@ocornut
Copy link
Owner

ocornut commented Nov 29, 2021

  • Another thing we will need take into account is Tabbing through InputTextMultiline() widgets. When they are configured to allow tab inputs, they cannot be tabbed out, and pressing ESC followed by Tab refocus the same item. This needs to be fixed as well.

EDIT Actually 66f0fb9 broke that, will fix soon.

ocornut added a commit that referenced this issue Nov 30, 2021
…3092)

Messy... Broken by 66f0fb9. Added ImGuiItemFlags_NoTabStop to EndGroup() ahead of time (not strictly needed here).
@ocornut ocornut changed the title Navigation using the Tab key Navigation over all kind of items using the Tab key Jan 21, 2022
@ocornut ocornut changed the title Navigation over all kind of items using the Tab key Tabbing/Navigation over all kind of items using the Tab key Jun 2, 2022
@ocornut ocornut added this to the v1.90 milestone Nov 2, 2022
ocornut added a commit that referenced this issue Mar 10, 2023
ocornut added a commit that referenced this issue Mar 10, 2023
@ocornut
Copy link
Owner

ocornut commented Mar 10, 2023

I have pushed the remaining glue to allow Tabbing to cycle through every items.

Note that "full" tabbing requires ImGuiConfigFlags_NavEnableKeyboard to be enabled.
Without ImGuiConfigFlags_NavEnableKeyboard, tabbing will imitate old behavior which is to only cycle through text-inputable inputables.

I have also switched examples application to enable both ImGuiConfigFlags_NavEnableKeyboard and ImGuiConfigFlags_NavEnableGamepad by default now.

@ocornut ocornut closed this as completed Mar 10, 2023
kjblanchard pushed a commit to kjblanchard/imgui that referenced this issue May 5, 2023
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 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
focus nav keyboard/gamepad navigation
Projects
None yet
Development

No branches or pull requests

4 participants