Re-structure packages

Overhaul of package structure and other cleanup.
This commit is contained in:
Dave Gallant
2020-04-03 22:29:12 -04:00
parent 025b68de93
commit 49ea48976d
9 changed files with 87 additions and 71 deletions

29
cui/keybindings.go Normal file
View File

@@ -0,0 +1,29 @@
package cui
import "github.com/jroimartin/gocui"
// Map keys to actions
func keybindings(g *gocui.Gui) error {
if err := g.SetKeybinding("", gocui.KeyTab, gocui.ModNone, nextView); err != nil {
return err
}
if err := g.SetKeybinding("", gocui.KeyArrowDown, gocui.ModNone, cursorDown); err != nil {
return err
}
if err := g.SetKeybinding("", gocui.KeyArrowUp, gocui.ModNone, cursorUp); err != nil {
return err
}
if err := g.SetKeybinding("", gocui.KeyCtrlC, gocui.ModNone, quit); err != nil {
return err
}
if err := g.SetKeybinding("feeds", gocui.KeyEnter, gocui.ModNone, openFeed); err != nil {
return err
}
if err := g.SetKeybinding("Items", gocui.KeyEnter, gocui.ModNone, openItem); err != nil {
return err
}
if err := g.SetKeybinding("", gocui.KeyF5, gocui.ModNone, refreshFeeds); err != nil {
return err
}
return nil
}