diff options
Diffstat (limited to 'widgets/terminal.go')
-rw-r--r-- | widgets/terminal.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/widgets/terminal.go b/widgets/terminal.go index 008a36f0..6ad6904b 100644 --- a/widgets/terminal.go +++ b/widgets/terminal.go @@ -311,6 +311,20 @@ func (term *Terminal) Draw(ctx *ui.Context) { } } +func (term *Terminal) MouseEvent(localX int, localY int, event tcell.Event) { + switch event := event.(type) { + case *tcell.EventMouse: + if term.OnEvent != nil { + if term.OnEvent(event) { + return + } + } + if term.closed { + return + } + } +} + func (term *Terminal) Focus(focus bool) { if term.closed { return |