diff options
Diffstat (limited to 'pkg/gui')
-rw-r--r-- | pkg/gui/menu_panel.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/pkg/gui/menu_panel.go b/pkg/gui/menu_panel.go index 6995a9fec..dbfa0cf01 100644 --- a/pkg/gui/menu_panel.go +++ b/pkg/gui/menu_panel.go @@ -39,8 +39,10 @@ func (gui *Gui) renderMenuOptions() error { } func (gui *Gui) handleMenuClose(g *gocui.Gui, v *gocui.View) error { - if err := g.DeleteKeybinding("menu", gocui.KeySpace, gocui.ModNone); err != nil { - return err + for _, key := range []gocui.Key{gocui.KeySpace, gocui.KeyEnter} { + if err := g.DeleteKeybinding("menu", key, gocui.ModNone); err != nil { + return err + } } err := g.DeleteView("menu") if err != nil { @@ -78,8 +80,10 @@ func (gui *Gui) createMenu(title string, items interface{}, handlePress func(int return gui.returnFocus(gui.g, menuView) } - if err := gui.g.SetKeybinding("menu", gocui.KeySpace, gocui.ModNone, wrappedHandlePress); err != nil { - return err + for _, key := range []gocui.Key{gocui.KeySpace, gocui.KeyEnter} { + if err := gui.g.SetKeybinding("menu", key, gocui.ModNone, wrappedHandlePress); err != nil { + return err + } } gui.g.Update(func(g *gocui.Gui) error { |