aboutsummaryrefslogtreecommitdiffstats
path: root/app/terminal.go
diff options
context:
space:
mode:
authorTim Culverhouse <tim@timculverhouse.com>2024-02-12 06:26:23 -0600
committerRobin Jarry <robin@jarry.cc>2024-02-12 13:48:56 +0100
commit58f94fa0a1333dfccfb24f90b22506b29a64397b (patch)
treeb2b9d4e89560f3c022807f6e1e66cc83f2c58de9 /app/terminal.go
parent4d14efc470926b3e0ab61efa6b7cdabae3cf1763 (diff)
downloadaerc-58f94fa0a1333dfccfb24f90b22506b29a64397b.tar.gz
mouse: use vaxis mouse events
Replace all tcell.EventMouse events with vaxis mouse events Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'app/terminal.go')
-rw-r--r--app/terminal.go9
1 files changed, 4 insertions, 5 deletions
diff --git a/app/terminal.go b/app/terminal.go
index c4ec374e..4814ff29 100644
--- a/app/terminal.go
+++ b/app/terminal.go
@@ -9,8 +9,6 @@ import (
"git.sr.ht/~rjarry/aerc/log"
"git.sr.ht/~rockorager/vaxis"
"git.sr.ht/~rockorager/vaxis/widgets/term"
-
- "github.com/gdamore/tcell/v2"
)
type HasTerminal interface {
@@ -108,7 +106,7 @@ func (term *Terminal) Terminal() *Terminal {
}
func (term *Terminal) MouseEvent(localX int, localY int, event vaxis.Event) {
- ev, ok := event.(*tcell.EventMouse)
+ ev, ok := event.(vaxis.Mouse)
if !ok {
return
}
@@ -118,8 +116,9 @@ func (term *Terminal) MouseEvent(localX int, localY int, event vaxis.Event) {
if term.isClosed() {
return
}
- e := tcell.NewEventMouse(localX, localY, ev.Buttons(), ev.Modifiers())
- term.vterm.Update(e)
+ ev.Row = localY
+ ev.Col = localX
+ term.vterm.Update(ev)
}
func (term *Terminal) Focus(focus bool) {