Extend the SGR Pixel mouse reporting protocol to also report when the mouse leaves the window

This commit is contained in:
Kovid Goyal
2025-07-12 11:59:23 +05:30
parent c3360cd76e
commit 4d3bbd82e0
8 changed files with 87 additions and 24 deletions

View File

@@ -72,6 +72,10 @@ func Run(args []string) (rc int, err error) {
return
}
lp.ClearScreen()
if current_mouse_event.Event_type == loop.MOUSE_LEAVE {
lp.Println("Mouse has left the window")
return
}
lp.Printf("Position: %d, %d (pixels)\r\n", current_mouse_event.Pixel.X, current_mouse_event.Pixel.Y)
lp.Printf("Cell : %d, %d\r\n", current_mouse_event.Cell.X, current_mouse_event.Cell.Y)
lp.Printf("Type : %s\r\n", current_mouse_event.Event_type)