Keynav works flawlessly

This commit is contained in:
2023-01-16 12:21:47 -05:00
parent 354d5f205d
commit fb0795ec7b
4 changed files with 37 additions and 37 deletions

View File

@@ -69,13 +69,15 @@ func (window *Window) handleKeyPress (
}
if key == tomo.KeyTab && modifiers.Alt {
if _, ok := window.child.(tomo.Selectable); ok {
if child, ok := window.child.(tomo.Selectable); ok {
direction := tomo.SelectionDirectionForward
if modifiers.Shift {
direction = tomo.SelectionDirectionBackward
}
window.advanceSelectionInChild(direction)
if !child.HandleSelection(direction) {
child.HandleDeselection()
}
}
} else if child, ok := window.child.(tomo.KeyboardTarget); ok {
// FIXME: pass correct value for repeated
@@ -83,17 +85,6 @@ func (window *Window) handleKeyPress (
}
}
func (window *Window) advanceSelectionInChild (direction tomo.SelectionDirection) {
child := window.child.(tomo.Selectable)
if child.Selected() {
if !child.HandleSelection(direction) {
child.HandleDeselection()
}
} else {
child.HandleSelection(tomo.SelectionDirectionNeutral)
}
}
func (window *Window) handleKeyRelease (
connection *xgbutil.XUtil,
event xevent.KeyReleaseEvent,