mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
23 lines
569 B
Go
23 lines
569 B
Go
package twitter
|
|
|
|
import (
|
|
"github.com/gdamore/tcell"
|
|
"github.com/wtfutil/wtf/wtf"
|
|
)
|
|
|
|
func (widget *Widget) initializeKeyboardControls() {
|
|
widget.SetKeyboardChar("/", widget.ShowHelp)
|
|
widget.SetKeyboardChar("h", widget.Prev)
|
|
widget.SetKeyboardChar("l", widget.Next)
|
|
widget.SetKeyboardChar("o", widget.openFile)
|
|
|
|
widget.SetKeyboardKey(tcell.KeyEnter, widget.openFile)
|
|
widget.SetKeyboardKey(tcell.KeyLeft, widget.Prev)
|
|
widget.SetKeyboardKey(tcell.KeyRight, widget.Next)
|
|
}
|
|
|
|
func (widget *Widget) openFile() {
|
|
src := widget.currentSourceURI()
|
|
wtf.OpenFile(src)
|
|
}
|