-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Need reliable way to set keyboard navigation position by code #3208
Comments
I believe it's missing a few functions right now. Basically there are three aspects to it:
TL;DR; is that it's currently not easy to do all of this from your side of thing but hopefully those three points can guide you toward a short-term workaround. I understand this is a current issue with Navigation which needs to be resolved, the problem being that if you dig into some gritty details it gets more tricky, but basically I should sit down and work on it. Being honest, some of the internal functions for Navigation are a large confusing mess, so our current approach is to first add more tests to clarify some of the subtle features and then we'd be in an easier position to make those changes without breaking stuff. |
Thanks @ocornut . I'm afraid that there's something more to it, because I was already making use of all the functions you mentioned. Could it be that the built-in tab navigation interferes with my attempts? Could that be turned off? Or could it possibly be the arrow key navigation system that is interfering? I know that one can be turned off globally, but could it be turned off for a specific window and its children? (Do not get me wrong though, the keyboard navigation system usually works very intuitively and is a genuine advantage over other UI libraries.) |
I don't think you should be attempting to implement manual tabbing, rather we should add tabbing support to the Navigation code. But also we should make it easier to hook various elements of Navigation for custom purpose, so that should still be possible ideally... |
After more than a dozen hours trying all kinds of combinations of
SetActiveID()
,SetNavID()
,SetFocusID()
SetKeyboardFocusHere()
and evenSetNavIDWithRectRel()
, I am completely stuck.What I need to do seems simple enough: I have to be able to set the keyboard navigation position to specific widgets by code, in order to create a tab sequence that will feel sufficiently natural to users.
I truly believe I've tried everything. I tried to follow the code, but must confess that I couldn't figure out how it works in this regard.
Following a suggestion from Discord, I also tried
ActivateItem()
, which was one of my many "almost worked" moments. The problem with that attempt was that, when applied to aTreeNode
, will also toggle it.I get the feeling that it cannot be as difficult as all that; after all, all I want is to imitate what the keyboard navigation system already does. But without help, I will have to abandon this and redesign my UI to work without keyboard navigation, though I'm afraid my customer will reject the result.
The text was updated successfully, but these errors were encountered: