Class TextModeMouseReporter
Captures mouse input and encodes it as ANSI terminal mouse reporting sequences. Requires a TerminalEmulator to read the active mouse tracking and encoding modes. When mouse reporting is active, selection input on an optional TextModeSelectionManager is automatically suppressed.
Inherited Members
Namespace: Scylla.TextMode
Assembly: ScyllaTextMode.dll
Syntax
[AddComponentMenu("Scylla/TextMode/TextMode Mouse Reporter")]
public class TextModeMouseReporter : MonoBehaviour
Remarks
Holding Shift selects text even while an application has mouse reporting on, as in xterm and most desktop terminals. While Shift is held the mouse is not reported, and a drag started with Shift continues to its release even if Shift is let go. The finished selection stays until the next one, so it can be copied. Turn ShiftSelectsText off to report Shift clicks to the application instead.
Properties
Emulator
Gets or sets the terminal emulator that provides mouse mode state. Mouse reporting is only active when this is non-null and the emulator's MouseTrackingMode is not None. When null or when tracking is disabled, selection input on the associated TextModeSelectionManager (if present) is automatically restored. Must be assigned via code; TerminalEmulator is not a Unity component.
Declaration
public TerminalEmulator Emulator { get; set; }
Property Value
| Type | Description |
|---|---|
| TerminalEmulator |
PublishEvents
Gets or sets whether to publish TextModeMouseReportingEvent via the SEX event system. Disabled by default due to high-frequency mouse event volume.
Declaration
public bool PublishEvents { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
ShiftSelectsText
Gets or sets whether holding Shift selects text while mouse reporting is active. On by default. When off, Shift clicks are reported to the application with the Shift modifier set.
Declaration
public bool ShiftSelectsText { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Events
OnMouseInput
Invoked when a mouse event is encoded into a terminal byte sequence. The consumer should feed these bytes to the terminal process or emulator input.
Declaration
public event Action<byte[]> OnMouseInput
Event Type
| Type | Description |
|---|---|
| Action<byte[]> |