Automatically passing focus around a grid

I'm building a UI that will be controlled by touch, mouse, keyboard, and gamepad.

Many screens have grids of buttons. I want to be able to use the dpad to move focus between items, and then use the Ⓐ button to invoke the button.

Is there any mechanism for automatically passing focus between items in a focus group based on direction? For example, I'd love it if FocusGroup had methods like moveFocusLeft(), moveFocusRight(), moveFocusUp(), moveFocusDown(). Do such methods exist anywhere, such that I could map dpad presses?

My current solution is to create state machines which each screen that pass focus around. This works, but is cumbersome to create and maintain.

Is there any mechanism to register the Ⓐ button to trigger the focused button? With the keyboard, I can tab to a button and hit space to invoke it, with no special event handling for the spacebar.

My current workaround is to explicitly handle the Ⓐ button events and run this code:if (root.activeFocusItem.clicked) root.activeFocusItem.clicked();
This works, but seems fragile.

Use the KeyNavigation attached properties on all buttons in QML to specify where focus should move when the arrow keys are pressed. With that keyboard arrow keys pass focus around. Dpad also seems to workout of the box for this; not sure why.

Use the (undocumented) GamepadKeyNavigation object to cause the A button to act the same as pressing the space key.

Here's an example of a simple 2x2 grid of buttons where focus gets moved by arrow keys and gamepad, and you can use space or 'A' button to press a button: