Class MouseSupport

java.lang.Object
org.jline.terminal.impl.MouseSupport

public class MouseSupport extends Object
Utility class for mouse support in terminals.

The MouseSupport class provides functionality for enabling, disabling, and processing mouse events in terminals that support mouse tracking. It handles the details of sending the appropriate escape sequences to the terminal to enable different mouse tracking modes and parsing the responses to create MouseEvent objects.

This class is used internally by terminal implementations to implement the mouse-related methods defined in the Terminal interface, such as Terminal.hasMouseSupport(), Terminal.trackMouse(Terminal.MouseTracking), and Terminal.readMouseEvent().

Mouse tracking in terminals typically works by:

  1. Sending special escape sequences to enable a specific mouse tracking mode
  2. Receiving escape sequences from the terminal when mouse events occur
  3. Parsing these sequences to extract information about the event type, button, modifiers, and coordinates
  4. Creating MouseEvent objects that represent these events

Note that mouse support is not available in all terminals, and the methods in this class may not work correctly if the terminal does not support mouse tracking.

See Also: