From 0aa82f5ba56f9e393e681971115881cc185f20c8 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 8 Feb 2025 08:07:03 -0600 Subject: trying to delay on mouse drag --- eventMouseMove.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'eventMouseMove.go') diff --git a/eventMouseMove.go b/eventMouseMove.go index eb6c2ee..2c70881 100644 --- a/eventMouseMove.go +++ b/eventMouseMove.go @@ -22,20 +22,29 @@ import ( // this function uses the mouse position to highlight & unhighlight things // this is run every time the user moves the mouse over the terminal window func mouseMove(g *gocui.Gui) { - w, h := g.MousePosition() me.ok = true // this tells init() it's okay to work with gocui - + // very useful for debugging in the past. also, just fun if me.supermouse { + w, h := g.MousePosition() for _, tk := range findByXY(w, h) { s := fmt.Sprintf("SM (%3d,%3d)", w, h) tk.dumpWidget(s) } } + /* + if time.Since(me.mouse.down) < me.mouse.clicktime { + log.Info("not yet") + return + } + */ + + w, h := g.MousePosition() // toggle off all highlight vies except for whatever is under the mouse for _, view := range g.Views() { view.Highlight = false } + if v, err := g.ViewByPosition(w, h); err == nil { v.Highlight = true } -- cgit v1.2.3