diff options
author | Suhas Karanth <sudo.suhas@gmail.com> | 2019-05-03 10:33:25 +0530 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2019-05-12 16:20:42 +1000 |
commit | 97f060d38d5f1d1b33e5826e86a5bc043294e376 (patch) | |
tree | 8a240890bfa5c7698462450624b9b6ab91620e85 /pkg/gui | |
parent | 357b8fa98fbb60639ca051081ebb82fc3fe58c19 (diff) |
Add field Alternative to gui.Binding
Document and use alternative keybinding for generating cheatsheet. Add
alt keybinding fn+up/down for scroll up/down actions.
Also run `go run scripts/generate_cheatsheet.go`.
Diffstat (limited to 'pkg/gui')
-rw-r--r-- | pkg/gui/keybindings.go | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go index fd4ed7625..4c1bdd184 100644 --- a/pkg/gui/keybindings.go +++ b/pkg/gui/keybindings.go @@ -13,6 +13,7 @@ type Binding struct { Key interface{} // FIXME: find out how to get `gocui.Key | rune` Modifier gocui.Modifier Description string + Alternative string } // GetDisplayStrings returns the display string of a file @@ -75,15 +76,17 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { Modifier: gocui.ModNone, Handler: gui.quit, }, { - ViewName: "", - Key: gocui.KeyPgup, - Modifier: gocui.ModNone, - Handler: gui.scrollUpMain, + ViewName: "", + Key: gocui.KeyPgup, + Modifier: gocui.ModNone, + Handler: gui.scrollUpMain, + Alternative: "fn+up", }, { - ViewName: "", - Key: gocui.KeyPgdn, - Modifier: gocui.ModNone, - Handler: gui.scrollDownMain, + ViewName: "", + Key: gocui.KeyPgdn, + Modifier: gocui.ModNone, + Handler: gui.scrollDownMain, + Alternative: "fn+down", }, { ViewName: "", Key: gocui.KeyCtrlU, |