aboutsummaryrefslogtreecommitdiff
path: root/ui/widget
diff options
context:
space:
mode:
authorTulir Asokan <tulir@maunium.net>2018-03-24 22:14:17 +0200
committerTulir Asokan <tulir@maunium.net>2018-03-24 22:14:17 +0200
commite414e20215db3a80bb1cf511390406324e742ebf (patch)
treef4375b7d9f8a8c277b8633bc3eeba3d8f105a7bd /ui/widget
parent1321e1a06ac8d8db13014e9c94aa52e1ffa32c1a (diff)
Add mouse handler stub and keep track of focus
Diffstat (limited to 'ui/widget')
-rw-r--r--ui/widget/room-view.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/ui/widget/room-view.go b/ui/widget/room-view.go
index 2e82a2d..2da3023 100644
--- a/ui/widget/room-view.go
+++ b/ui/widget/room-view.go
@@ -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 {