Table of Contents

Method Encode

Namespace
Terminal.Gui.Drivers
Assembly
Terminal.Gui.dll

Encode(Mouse)

Converts a Mouse event to an ANSI SGR (1006) extended mouse format escape sequence.

public static string Encode(Mouse mouse)

Parameters

mouse Mouse

The mouse event to convert.

Returns

string

ANSI escape sequence string in format: ESC[<button;x;yM or ESC[<button;x;ym

Remarks

SGR format: ESC[<button;x;y{M|m}

  • M = press, m = release
  • Coordinates are 1-based in ANSI (Terminal.Gui uses 0-based)
  • Button codes encode both the button and modifier keys