github.com/wtfutil/wtf@v0.43.0/modules/pivotal/keyboard.go (about) 1 package pivotal 2 3 import ( 4 "github.com/gdamore/tcell/v2" 5 ) 6 7 func (widget *Widget) initializeKeyboardControls() { 8 widget.InitializeHelpTextKeyboardControl(widget.ShowHelp) 9 widget.InitializeRefreshKeyboardControl(widget.Refresh) 10 11 widget.SetKeyboardChar("j", widget.Next, "Select next item") 12 widget.SetKeyboardChar("k", widget.Prev, "Select previous item") 13 widget.SetKeyboardChar("l", widget.NextSource, "Select next source") 14 widget.SetKeyboardChar("h", widget.PrevSource, "Select previous source") 15 widget.SetKeyboardChar("o", widget.Open, "Open item in browser") 16 widget.SetKeyboardChar("p", widget.OpenPulls, "Open pull requests in browser") 17 18 widget.SetKeyboardKey(tcell.KeyDown, widget.Next, "Select next item") 19 widget.SetKeyboardKey(tcell.KeyUp, widget.Prev, "Select previous item") 20 widget.SetKeyboardKey(tcell.KeyRight, widget.NextSource, "Select next source") 21 widget.SetKeyboardKey(tcell.KeyLeft, widget.PrevSource, "Select previous source") 22 widget.SetKeyboardKey(tcell.KeyEnter, widget.Open, "Open PR in browser") 23 widget.SetKeyboardKey(tcell.KeyEsc, widget.Unselect, "Clear selection") 24 }