summaryrefslogtreecommitdiff
path: root/junk1.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-01-31 11:34:23 -0600
committerJeff Carr <[email protected]>2025-01-31 13:47:45 -0600
commitbbdf7fefbd9d812b4db575a57d9d159d68921f7f (patch)
tree50b850c24e99e9757ff7a802f33076dbd6a7ac2f /junk1.go
parent73de9899a890d3babfebb2427397fb82dcc021c9 (diff)
make keyboard 'f' show what widgets are under the mouse
Diffstat (limited to 'junk1.go')
-rw-r--r--junk1.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/junk1.go b/junk1.go
index de8c104..1ed2d7e 100644
--- a/junk1.go
+++ b/junk1.go
@@ -5,6 +5,7 @@
package main
import (
+ "fmt"
"syscall"
"github.com/awesome-gocui/gocui"
@@ -99,6 +100,15 @@ func addDebugKeys(g *gocui.Gui) {
return nil
})
+ // find under mouse
+ g.SetKeybinding("", 'f', gocui.ModNone,
+ func(g *gocui.Gui, v *gocui.View) error {
+ w, h := g.MousePosition()
+ for _, tk := range findByXY(w, h) {
+ log.Log(GOCUI, fmt.Sprintf("findByXY() msgDown() %s wId=%d cuiName=%s at (%d,%d)", tk.WidgetType, tk.node.WidgetId, tk.cuiName, w, h))
+ }
+ return nil
+ })
// hide all widgets
g.SetKeybinding("", 'h', gocui.ModNone,
func(g *gocui.Gui, v *gocui.View) error {