From 3d5ee3f89b73dd5ba0d78a0b0d816fe96ed9f8a0 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 1 Feb 2025 16:44:43 -0600 Subject: this gocui package is really cool --- eventMouse.go | 37 +------------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) (limited to 'eventMouse.go') diff --git a/eventMouse.go b/eventMouse.go index 383185b..052bc53 100644 --- a/eventMouse.go +++ b/eventMouse.go @@ -1,19 +1,6 @@ // Copyright 2017-2025 WIT.COM Inc. All rights reserved. // Use of this source code is governed by the GPL 3.0 -// NOTE: our code is under the GPL, not BSD - -// note by jcarr@wit.com in 2025: this is one of the coolest -// things ever what this does. I've tried to improve -// it while I've been working on making a gocui -// GO plugin so it can be generalized as a useful -// console interface. Well done everyone that has -// contributed to this gocui project !!! - -// Copyright 2014 The gocui Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - package main import ( @@ -25,29 +12,7 @@ import ( "go.wit.com/log" ) -// 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) { - mx, my := g.MousePosition() - - w := mx - h := my - - if me.supermouse { - for _, tk := range findByXY(w, h) { - tk.dumpWidget("mouseMove()") - } - } - - for _, view := range g.Views() { - view.Highlight = false - } - if v, err := g.ViewByPosition(mx, my); err == nil { - v.Highlight = true - } -} - -// I think this lets me drag the debugging window +// event triggers when you push down on a mouse button func msgDown(g *gocui.Gui, v *gocui.View) error { initialMouseX, initialMouseY = g.MousePosition() -- cgit v1.2.3