23 lines
294 B
Go
23 lines
294 B
Go
|
package views
|
||
|
|
||
|
import (
|
||
|
"tui"
|
||
|
|
||
|
"github.com/gdamore/tcell"
|
||
|
)
|
||
|
|
||
|
type EventView struct {
|
||
|
tui.ViewTmpl
|
||
|
KeyPressed func(key tcell.Key)
|
||
|
}
|
||
|
|
||
|
func (v *EventView) OnKeyPressed(key tcell.Key) {
|
||
|
if v.KeyPressed != nil {
|
||
|
v.KeyPressed(key)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
func NewEventView() *EventView {
|
||
|
return &EventView{}
|
||
|
}
|