1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00
wtf/modules/mercurial/keyboard.go
Chris Cummer 5337656c58 Remove the need for every module to define a widget.ShowHelp keyboard control
This common functionality is moved up to KeyboardWidget. Modules now
include widget.InitializeCommonControls() instead.
2019-08-23 21:18:51 -07:00

17 lines
636 B
Go

package mercurial
import "github.com/gdamore/tcell"
func (widget *Widget) initializeKeyboardControls() {
widget.InitializeCommonControls()
widget.SetKeyboardChar("r", widget.Refresh, "Refresh widget")
widget.SetKeyboardChar("l", widget.NextSource, "Select next source")
widget.SetKeyboardChar("h", widget.PrevSource, "Select previous source")
widget.SetKeyboardChar("p", widget.Pull, "Pull repo")
widget.SetKeyboardChar("c", widget.Checkout, "Checkout branch")
widget.SetKeyboardKey(tcell.KeyRight, widget.NextSource, "Select next source")
widget.SetKeyboardKey(tcell.KeyLeft, widget.PrevSource, "Select previous source")
}