From 029de4ac862fe999bb6a2ee759a56c7fadb065d4 Mon Sep 17 00:00:00 2001 From: David Chen Date: Sun, 8 Dec 2019 14:57:29 -0800 Subject: re-position key names so that the menu will show 'enter' instead of 'ctrl-m', or 'esc' instead of 'ctrl-[' --- pkg/gui/keybindings.go | 66 +++++++++++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'pkg/gui/keybindings.go') diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go index 6e5d7fb93..810188bcc 100644 --- a/pkg/gui/keybindings.go +++ b/pkg/gui/keybindings.go @@ -32,6 +32,39 @@ func (b *Binding) GetKey() string { case rune: key = int(b.Key.(rune)) case gocui.Key: + if b.Key.(gocui.Key) == gocui.KeyCtrlSpace { + return "ctrl+space" + } + if b.Key.(gocui.Key) == gocui.KeyCtrlBackslash { + return "ctrl+\\" + } + if b.Key.(gocui.Key) == gocui.KeyCtrlLsqBracket { + return "ctrl+[" + } + if b.Key.(gocui.Key) == gocui.KeyCtrlRsqBracket { + return "ctrl+]" + } + if b.Key.(gocui.Key) == gocui.KeyCtrlSlash { + return "ctrl+/" + } + if b.Key.(gocui.Key) == gocui.KeyCtrlUnderscore { + return "ctrl+_" + } + if b.Key.(gocui.Key) == gocui.KeyBackspace { + return "backspace" + } + if b.Key.(gocui.Key) == gocui.KeyTab { + return "tab" + } + if b.Key.(gocui.Key) == gocui.KeyEnter { + return "enter" + } + if b.Key.(gocui.Key) == gocui.KeyEsc { + return "esc" + } + if b.Key.(gocui.Key) == gocui.KeySpace { + return "space" + } if b.Key.(gocui.Key) == gocui.KeyCtrlA { return "ctrl+a" } @@ -134,39 +167,6 @@ func (b *Binding) GetKey() string { if b.Key.(gocui.Key) == gocui.KeyCtrl8 { return "ctrl+8" } - if b.Key.(gocui.Key) == gocui.KeyCtrlSpace { - return "ctrl+space" - } - if b.Key.(gocui.Key) == gocui.KeyCtrlBackslash { - return "ctrl+\\" - } - if b.Key.(gocui.Key) == gocui.KeyCtrlLsqBracket { - return "ctrl+[" - } - if b.Key.(gocui.Key) == gocui.KeyCtrlRsqBracket { - return "ctrl+]" - } - if b.Key.(gocui.Key) == gocui.KeyCtrlSlash { - return "ctrl+/" - } - if b.Key.(gocui.Key) == gocui.KeyCtrlUnderscore { - return "ctrl+_" - } - if b.Key.(gocui.Key) == gocui.KeyBackspace { - return "backspace" - } - if b.Key.(gocui.Key) == gocui.KeyTab { - return "tab" - } - if b.Key.(gocui.Key) == gocui.KeyEnter { - return "enter" - } - if b.Key.(gocui.Key) == gocui.KeyEsc { - return "esc" - } - if b.Key.(gocui.Key) == gocui.KeySpace { - return "space" - } if b.Key.(gocui.Key) == gocui.KeyF1 { return "f1" } -- cgit v1.2.3