diff options
| author | Jeff Carr <[email protected]> | 2025-01-31 11:34:23 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-01-31 13:47:45 -0600 |
| commit | bbdf7fefbd9d812b4db575a57d9d159d68921f7f (patch) | |
| tree | 50b850c24e99e9757ff7a802f33076dbd6a7ac2f /junk1.go | |
| parent | 73de9899a890d3babfebb2427397fb82dcc021c9 (diff) | |
make keyboard 'f' show what widgets are under the mouse
Diffstat (limited to 'junk1.go')
| -rw-r--r-- | junk1.go | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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 { |
