1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00
wtf/modules/datadog/keyboard.go
Sean Smith 210723cd74 Create abtract scrollable widget
This cleans up a bunch of boilerplate for scrollable items and standardizes their usage
2019-05-10 17:06:45 -04:00

18 lines
499 B
Go

package datadog
import (
"github.com/gdamore/tcell"
)
func (widget *Widget) initializeKeyboardControls() {
widget.SetKeyboardChar("/", widget.ShowHelp)
widget.SetKeyboardChar("j", widget.Next)
widget.SetKeyboardChar("k", widget.Prev)
widget.SetKeyboardChar("o", widget.openItem)
widget.SetKeyboardKey(tcell.KeyDown, widget.Next)
widget.SetKeyboardKey(tcell.KeyEnter, widget.openItem)
widget.SetKeyboardKey(tcell.KeyEsc, widget.Unselect)
widget.SetKeyboardKey(tcell.KeyUp, widget.Prev)
}