260429.1 · 0b7b849eade404a9ccbeb2c8ceaafb2033574577
feat: support pixel-precision mouse reporting (CSI ?1016h)
Adds a new MouseFlags value, MousePixelEvents, that acts as a modifier on top of MouseButtonEvents/MouseDragEvents/MouseMotionEvents. When set, EnableMouse emits PmMouseSgrPixel instead of PmMouseSgr and the input parser skips its cell-size clamp on mouse coordinates so pixel positions pass through to EventMouse.Position() unchanged. Default behavior is unchanged.
Includes tests pinning both the existing clip behavior and the new pixel-mode passthrough including the toggle-off transition.
reading declarations
Changes to mouse.go. All files
@@ -49,8 +49,9 @@ func (ev *EventMouse) Modifiers() ModMask { return ev.mod } -// Position returns the mouse position in character cells. The origin-// 0, 0 is at the upper left corner.+// Position returns the mouse position. The origin 0, 0 is at the upper+// left corner. The unit is character cells unless the screen was started+// with MousePixelEvents, in which case the unit is terminal pixels. func (ev *EventMouse) Position() (int, int) { return ev.x, ev.y }