diff options
author | David Chen <weichen2000121@gmail.com> | 2019-12-06 10:26:39 -0800 |
---|---|---|
committer | David Chen <weichen2000121@gmail.com> | 2019-12-06 10:26:39 -0800 |
commit | c89c35c6b37935def3341d85dc7a5ae9aa447a65 (patch) | |
tree | 51a3d080456d1f56e283edb6971934cae2f1f74b /pkg/gui | |
parent | 1dbfea54bc84c039bfac8d4df3fcefb9ecd133a4 (diff) |
bug fix: ctrl+combinations was not showing up in help menu
Diffstat (limited to 'pkg/gui')
-rw-r--r-- | pkg/gui/keybindings.go | 195 |
1 files changed, 195 insertions, 0 deletions
diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go index 7ea457bfd..b009f8f3d 100644 --- a/pkg/gui/keybindings.go +++ b/pkg/gui/keybindings.go @@ -32,12 +32,207 @@ func (b *Binding) GetKey() string { case rune: key = int(b.Key.(rune)) case gocui.Key: + if b.Key.(gocui.Key) == gocui.KeyCtrlA { + return "ctrl+a" + } + if b.Key.(gocui.Key) == gocui.KeyCtrlB { + return "ctrl+b" + } + if b.Key.(gocui.Key) == gocui.KeyCtrlC { + return "ctrl+c" + } + if b.Key.(gocui.Key) == gocui.KeyCtrlD { + return "ctrl+d" + } + if b.Key.(gocui.Key) == gocui.KeyCtrlE { + return "ctrl+e" + } + if b.Key.(gocui.Key) == gocui.KeyCtrlF { + return "ctrl+f" + } + if b.Key.(gocui.Key) == gocui.KeyCtrlG { + return "ctrl+g" + } + if b.Key.(gocui.Key) == gocui.KeyCtrlH { + return "ctrl+h" + } + if b.Key.(gocui.Key) == gocui.KeyCtrlI { + return "ctrl+i" + } if b.Key.(gocui.Key) == gocui.KeyCtrlJ { return "ctrl+j" } if b.Key.(gocui.Key) == gocui.KeyCtrlK { return "ctrl+k" } + if b.Key.(gocui.Key) == gocui.KeyCtrlL { + return "ctrl+l" + } + if b.Key.(gocui.Key) == gocui.KeyCtrlM { + return "ctrl+m" + } + if b.Key.(gocui.Key) == gocui.KeyCtrlN { + return "ctrl+n" + } + if b.Key.(gocui.Key) == gocui.KeyCtrlO { + return "ctrl+o" + } + if b.Key.(gocui.Key) == gocui.KeyCtrlP { + return "ctrl+p" + } + if b.Key.(gocui.Key) == gocui.KeyCtrlQ { + return "ctrl+q" + } + if b.Key.(gocui.Key) == gocui.KeyCtrlR { + return "ctrl+r" + } + if b.Key.(gocui.Key) == gocui.KeyCtrlS { + return "ctrl+s" + } + if b.Key.(gocui.Key) == gocui.KeyCtrlT { + return "ctrl+t" + } + if b.Key.(gocui.Key) == gocui.KeyCtrlU { + return "ctrl+u" + } + if b.Key.(gocui.Key) == gocui.KeyCtrlV { + return "ctrl+v" + } + if b.Key.(gocui.Key) == gocui.KeyCtrlW { + return "ctrl+w" + } + if b.Key.(gocui.Key) == gocui.KeyCtrlX { + return "ctrl+x" + } + if b.Key.(gocui.Key) == gocui.KeyCtrlY { + return "ctrl+y" + } + if b.Key.(gocui.Key) == gocui.KeyCtrlZ { + return "ctrl+z" + } + if b.Key.(gocui.Key) == gocui.KeyCtrlTilde { + return "ctrl+~" + } + if b.Key.(gocui.Key) == gocui.KeyCtrl2 { + return "ctrl+2" + } + if b.Key.(gocui.Key) == gocui.KeyCtrl3 { + return "ctrl+3" + } + if b.Key.(gocui.Key) == gocui.KeyCtrl4 { + return "ctrl+4" + } + if b.Key.(gocui.Key) == gocui.KeyCtrl5 { + return "ctrl+5" + } + if b.Key.(gocui.Key) == gocui.KeyCtrl6 { + return "ctrl+6" + } + if b.Key.(gocui.Key) == gocui.KeyCtrl7 { + return "ctrl+7" + } + 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" + } + if b.Key.(gocui.Key) == gocui.KeyF2 { + return "f2" + } + if b.Key.(gocui.Key) == gocui.KeyF3 { + return "f3" + } + if b.Key.(gocui.Key) == gocui.KeyF4 { + return "f4" + } + if b.Key.(gocui.Key) == gocui.KeyF5 { + return "f5" + } + if b.Key.(gocui.Key) == gocui.KeyF6 { + return "f6" + } + if b.Key.(gocui.Key) == gocui.KeyF7 { + return "f7" + } + if b.Key.(gocui.Key) == gocui.KeyF8 { + return "f8" + } + if b.Key.(gocui.Key) == gocui.KeyF9 { + return "f9" + } + if b.Key.(gocui.Key) == gocui.KeyF10 { + return "f10" + } + if b.Key.(gocui.Key) == gocui.KeyF11 { + return "f11" + } + if b.Key.(gocui.Key) == gocui.KeyF12 { + return "f12" + } + if b.Key.(gocui.Key) == gocui.KeyInsert { + return "insert" + } + if b.Key.(gocui.Key) == gocui.KeyDelete { + return "delete" + } + if b.Key.(gocui.Key) == gocui.KeyHome { + return "home" + } + if b.Key.(gocui.Key) == gocui.KeyEnd { + return "end" + } + if b.Key.(gocui.Key) == gocui.KeyPgup { + return "pgup" + } + if b.Key.(gocui.Key) == gocui.KeyPgdn { + return "pgdown" + } + if b.Key.(gocui.Key) == gocui.KeyArrowUp { + return "up" + } + if b.Key.(gocui.Key) == gocui.KeyArrowDown { + return "down" + } + if b.Key.(gocui.Key) == gocui.KeyArrowLeft { + return "left" + } + if b.Key.(gocui.Key) == gocui.KeyArrowRight { + return "right" + } key = int(b.Key.(gocui.Key)) } |