diff --git a/screen.go b/screen.go index 7981c5d..7956763 100644 --- a/screen.go +++ b/screen.go @@ -32,16 +32,20 @@ const ( EraseEntireLineSeq = "2K" // Mouse. - EnableMousePressSeq = "?9h" // press only (X10) - DisableMousePressSeq = "?9l" - EnableMouseSeq = "?1000h" // press, release, wheel - DisableMouseSeq = "?1000l" - EnableMouseHiliteSeq = "?1001h" // highlight - DisableMouseHiliteSeq = "?1001l" - EnableMouseCellMotionSeq = "?1002h" // press, release, move on pressed, wheel - DisableMouseCellMotionSeq = "?1002l" - EnableMouseAllMotionSeq = "?1003h" // press, release, move, wheel - DisableMouseAllMotionSeq = "?1003l" + EnableMousePressSeq = "?9h" // press only (X10) + DisableMousePressSeq = "?9l" + EnableMouseSeq = "?1000h" // press, release, wheel + DisableMouseSeq = "?1000l" + EnableMouseHiliteSeq = "?1001h" // highlight + DisableMouseHiliteSeq = "?1001l" + EnableMouseCellMotionSeq = "?1002h" // press, release, move on pressed, wheel + DisableMouseCellMotionSeq = "?1002l" + EnableMouseAllMotionSeq = "?1003h" // press, release, move, wheel + DisableMouseAllMotionSeq = "?1003l" + EnableMouseExtendedMotionSeq = "?1003;1006h" // press, release, move, wheel, extended coordinates + DisableMouseExtendedMotionSeq = "?1003;1006l" + EnableMousePixelsMotionSeq = "?1003;1016h" // press, release, move, wheel, extended pixel coordinates + DisableMousePixelsMotionSeq = "?1003;1016l" // Screen. RestoreScreenSeq = "?47l" @@ -259,6 +263,26 @@ func (o Output) DisableMouseAllMotion() { fmt.Fprint(o.tty, CSI+DisableMouseAllMotionSeq) } +// EnableMouseExtendedMotion enables Extended Mouse mode (SGR). +func (o Output) EnableMouseExtendedMotion() { + fmt.Fprint(o.tty, CSI+EnableMouseExtendedMotionSeq) +} + +// DisableMouseExtendedMotion disables Extended Mouse mode (SGR). +func (o Output) DisableMouseExtendedMotion() { + fmt.Fprint(o.tty, CSI+DisableMouseExtendedMotionSeq) +} + +// EnableMousePixelsMotion enables Pixel Motion Mouse mode (SGR-Pixels). +func (o Output) EnableMousePixelsMotion() { + fmt.Fprint(o.tty, CSI+EnableMousePixelsMotionSeq) +} + +// DisableMousePixelsMotion disables Pixel Motion Mouse mode (SGR-Pixels). +func (o Output) DisableMousePixelsMotion() { + fmt.Fprint(o.tty, CSI+DisableMousePixelsMotionSeq) +} + // SetWindowTitle sets the terminal window title. func (o Output) SetWindowTitle(title string) { fmt.Fprintf(o.tty, OSC+SetWindowTitleSeq, title)