slint icon indicating copy to clipboard operation
slint copied to clipboard

Support tab focus: specify the tab order in slint code

Open tronical opened this issue 5 years ago • 1 comments

We need the ability to specify how pressing the tab and shift-tab keys allows navigating through ui-elements. This way buttons can accept the keyboard focus for example and can be activated using the enter key.

tronical avatar Oct 05 '20 07:10 tronical

When having a multi-line text box as part of the UI that allows to insert tab characters, this case must be handled in a special way to prevent that the user is forced to resort to the mouse to get the focus away from the text box.

I think I have seen both of these behaviors years ago, and GPT-4o without me priming it also came up with them:

  • Tab to insert tab character, Ctrl+Tab to move focus away
  • Tab to move focus away, Ctrl+Tab to insert tab character

Maybe, which of these options is chosen depends on how important the ability to insert tab characters is for the app.

I guess the set of key combos for reversed focus traversal direction depends on whether Shift+Tab in the text box unindents the current line like in an IDE.

Enyium avatar Sep 19 '24 13:09 Enyium