I've been toying with a cells demo and getting "tabbing" to work.
It's still very rough, but was fairly easy to start. There's some work on how
to handle non-keyboard inputs, and the blinkers, etc.
Here's the super complicated algorithm. ;) It can probably be simplified, but
it's just a simple DFS. Technically Fidget allows overlapping text inputs, etc,
so there needs to be some safety / sanity around that.
proc nextFocus*(parent, node: Node, foundFocus: var bool): bool =
## find the next node to focus on
for child in node.nodes:
if child.selectable:
if foundFocus:
child.setFocus = true
return true
if child == keyboard.focusNode:
foundFocus = true
else:
if nextFocus(node, child, foundFocus):
return
Run