arcade icon indicating copy to clipboard operation
arcade copied to clipboard

Adding focus traversal to GUI

Open eschan145 opened this issue 3 years ago • 2 comments

In a standard GUI application, a user can switch the focus of widgets by pressing Tab and going back with Shift-Tab. It would be nice if that could be implemented in the current arcade GUI. You would need a focus property for each widget to see if it had focus and do something (eg. use an OpenGL filter to make it glow) and a focus property for the UIManager. The focus property in the UIManager could be used to find out which widget had the current focus.

Check out this example and try pressing Tab several times. Note that the focus switches between the entries. UILabels should not have focus traversal. Once a widget has focus, the user could call it with a keyboard shortcut (like Space to dispatch the on_press event for buttons and Up and Down to scroll up and down in TextAreas.

eschan145 avatar Jul 10 '22 03:07 eschan145

Good call, as soon as we have a focus state in the GUI this should come next!

eruvanos avatar Sep 01 '22 20:09 eruvanos