victronenergy / gui-v2

Other
15 stars 5 forks source link

Add keyboard navigation to gui-v2 #1030

Open jpetrell opened 2 weeks ago

jpetrell commented 2 weeks ago

In gui-v1, there is keyboard navigation when using it on Remote console. And that is used everyday by many technicians that sit behind their laptop and sort issues out or configure systems. Enable keyboard navigation on gui-v2 also.

image

jpetrell commented 2 weeks ago

Arrow navigation e.g. between main views and vertically on the settings pages seems pretty straight-forward (i.e. the keyboard focus is moved to the adjacent item that is located in the arrow direction), and for the common UI components (dialogs, sliders, spin boxes, etc.) I can initially use gui-v1 behavior as an example.

Some open items to decide:

jpetrell commented 1 week ago

Key navigation prototype: Screencast from 2024-05-03 13-28-08.webm

Branch: https://github.com/victronenergy/gui-v2/pull/new/jpetrell/key-navigation

Doesn't require many lines of code to get the main navigation paths covered, thanks to nice key navigation enablers in Qt Quick. But adding support for all the settings pages and dozens of different list items and controls (dialogs, sliders, etc.) will take few days. One enabler that is missing is ObjectModel variant that removes hidden items from the model like done by VisibleItemModel for gui-v1, which is needed so ListView navigation doesn't try to move focus to the hidden (disabled/disallowed) settings items.

jpetrell commented 1 week ago

Current key navigation on gui-v1:

gui-v1 shows slightly different controls when you access the spin box or text field setting using touch or with keyboard:

image

Should we show the keyboard layout somewhere like shown above in the Remote Console case?

image