aboutsummaryrefslogtreecommitdiff
path: root/ui/widget
diff options
context:
space:
mode:
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 {