From 70d734e8e209a5830acd785648777b367e4c63ec Mon Sep 17 00:00:00 2001 From: "Luke I. Wilson" Date: Fri, 19 Mar 2021 20:21:46 -0500 Subject: [PATCH] Added using tab to move cursor in MenuBar and Menu --- ui/menu.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ui/menu.go b/ui/menu.go index cbf73a5..92ebc8a 100644 --- a/ui/menu.go +++ b/ui/menu.go @@ -206,6 +206,12 @@ func (b *MenuBar) HandleEvent(event tcell.Event) bool { b.CursorLeft() case tcell.KeyRight: b.CursorRight() + case tcell.KeyTab: + if b.menusVisible { + return b.Menus[b.selected].HandleEvent(event) + } else { + b.CursorRight() + } case tcell.KeyRune: // Search for the matching quick char in menu names if !b.menusVisible { // If the selected Menu is not open/visible @@ -386,6 +392,8 @@ func (m *Menu) HandleEvent(event tcell.Event) bool { m.ActivateItemUnderCursor() case tcell.KeyUp: m.CursorUp() + case tcell.KeyTab: + fallthrough case tcell.KeyDown: m.CursorDown()