Add mouse handler stub and keep track of focus

This commit is contained in:
Tulir Asokan
2018-03-24 22:14:17 +02:00
parent 1321e1a06a
commit e414e20215
2 changed files with 26 additions and 3 deletions

View File

@ -95,6 +95,13 @@ func (view *RoomView) SetInputCapture(fn func(room *RoomView, event *tcell.Event
return view
}
func (view *RoomView) SetMouseCapture(fn func(room *RoomView, event *tcell.EventMouse) *tcell.EventMouse) *RoomView {
view.input.SetMouseCapture(func(event *tcell.EventMouse) *tcell.EventMouse {
return fn(view, event)
})
return view
}
func (view *RoomView) SetInputSubmitFunc(fn func(room *RoomView, text string)) *RoomView {
view.input.SetDoneFunc(func(key tcell.Key) {
if key == tcell.KeyEnter {