icy_tools icon indicating copy to clipboard operation
icy_tools copied to clipboard

IcyTerm mouse events

Open opicron opened this issue 8 months ago • 0 comments

Ha I am in the process of making my Mystic Mods compatible with mouse events. Will IcyTerm support these mouse events eventually?

The ansi codes used to send the mouse button and coordinates is pretty straightforward:

mousedown = ESC[M {mouse button} {ascii value of xpos + 32} {ascii value of ypos + 32} mouseup = ESC[M 3 {ascii value of xpos + 32} {ascii value of ypos + 32}

For example: ESC[M0!! is left mouse button on 1,1

As per documentation X10 xterm:

https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Mouse-Tracking

Normal tracking mode sends an escape sequence on both button press and
release.  Modifier key (shift, ctrl, meta) information is also sent.  It
is enabled by specifying parameter 1000 to DECSET.  On button press or
release, xterm sends CSI M CbCxCy.

o   The low two bits of Cb encode button information:

              0=MB1 pressed,
              1=MB2 pressed,
              2=MB3 pressed, and
              3=release.

o   The next three bits encode the modifiers which were down when the
    button was pressed and are added together:

              4=Shift,
              8=Meta, and
              16=Control.

o   Cx and Cy are the x and y coordinates of the mouse event, encoded as
    in X10 mode.

opicron avatar May 05 '25 11:05 opicron