diff options
author | David Chen <weichen2000121@gmail.com> | 2019-12-08 14:57:29 -0800 |
---|---|---|
committer | David Chen <weichen2000121@gmail.com> | 2019-12-08 14:57:29 -0800 |
commit | 029de4ac862fe999bb6a2ee759a56c7fadb065d4 (patch) | |
tree | 93cdf1914a69d5328202495a38dfbaf2f083cefd | |
parent | 5f21f190b987f2339213e18abdc94bb3402ca2d1 (diff) |
re-position key names so that the menu will show 'enter' instead of 'ctrl-m', or 'esc' instead of 'ctrl-['
-rw-r--r-- | pkg/gui/keybindings.go | 66 |
1 files changed, 33 insertions, 33 deletions
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" } |