Skip to content

Allow keyboard focus for toolbar actions

Visually-impaired users need to be able to trigger common actions easily. Applications have a curated list of those on the toolbar, but prior to this commit most of these buttons in most applications would not accept keyboard focus in any way, effectively prohibiting blind users from discovering or triggering this curated list of actions.

If actions are only available from the toolbar, it could even be possible that users who only use the keyboard would have no way of triggering those actions at all. However, KDE design guidelines typically encourage that those actions are also available through a menu bar.

This commit fixes the above. Now all buttons on the toolbar will get keyboard focus sooner or later when a user presses the Tab key often enough.

As a side-effect this also means that the context menu of those actions can also be opened by keyboard, because the Menu key will open the context menu when such an action has keyboard focus. This is nice because there can be advanced functionality in there. For example in Dolphin: In the context menu of the "Go Back" action there are entries to directly jump to a previously visited location.

Test plan

  1. Open any application using the KXmlGui framework.
  2. Use the Tab key until you reach the toolbar. (Applications might have Tab-focus cycles that might prevent that you ever arrive at the toolbar.)
  3. Use the Menu key on your keyboard (if you have one) to open the context menu for the toolbar button.

Merge request reports