package views import ( "git.tordarus.net/Tordarus/tui" ) type EventView struct { tui.WrapperTmpl View tui.View KeyPressed func(event *tui.KeyEvent) (consumed bool) } func NewEventView(view tui.View) *EventView { return &EventView{View: view} } func (v *EventView) OnKeyPressed(event *tui.KeyEvent) (consumed bool) { if v.KeyPressed != nil { return v.KeyPressed(event) } return v.ViewTmpl.OnKeyPressed(event) } func (v *EventView) Draw(buf *tui.ViewBuffer) { v.View.Draw(buf) }