I wonder if someone has experience in building user interface navigable without mouse (ex: on TV, game consoles, etc).
I remember obsessing over the nav system because pretty much every UI system I worked with required wiring the direction keys manually, and making sure there were no "
focus traps", etc.
Anyway,
this nice simulation of delaunay triangulation gave me the idea of a possible way to wire direction keys automatically.
I think some heuristic like this could work:
• Make sure every edge between to widgets connected through the euclidean minimum spanning tree is assigned to one of the cardinal directions.
• For each widget, fill the rest of the cardinal directions using the relative neighborhood graph, and remembering which widget we "came from" in the opposite direction.
As usual, the devil is in the details .... for instance:
• I imagine each widget would have to be modeled with a bounding area instead of a single point ...
• Care would need to be put if bounding areas overlap
◦ Some widgets may still require tracking its own focus before delegating to the pre-calculated target (for ex., I imagine a scrolling gallery in the middle of the screen surrounded with buttons... 😭)
• Etc, etc, etc ....
There's a reason most UI frameworks just ask the programmer to do wire navigation by hand 😄