diff options
| author | Jeff Carr <[email protected]> | 2025-02-08 08:07:03 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-02-08 08:07:03 -0600 |
| commit | 0aa82f5ba56f9e393e681971115881cc185f20c8 (patch) | |
| tree | 74c5e8276da5e4fe29ea682c44a1f0f6aefca3df /eventMouseMove.go | |
| parent | 83b4d7142a32230e5f037758ebe0f8f279fed7f5 (diff) | |
trying to delay on mouse drag
Diffstat (limited to 'eventMouseMove.go')
| -rw-r--r-- | eventMouseMove.go | 13 |
1 files changed, 11 insertions, 2 deletions
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 } |
