Class MouseTracking
java.lang.Object
org.aesh.terminal.tty.MouseTracking
Controls mouse tracking on the terminal.
Mouse tracking is enabled by sending DEC private mode sequences to the terminal. The protocol controls which events are reported, and the encoding controls how coordinates are transmitted.
Example usage:
// Enable normal tracking with SGR encoding MouseTracking.enable(connection, MouseTracking.Protocol.NORMAL); MouseTracking.enableEncoding(connection, MouseTracking.Encoding.SGR); // ... handle mouse events ... // Disable on cleanup MouseTracking.disable(connection, MouseTracking.Protocol.NORMAL); MouseTracking.disableEncoding(connection, MouseTracking.Encoding.SGR);
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumMouse coordinate encoding — controls how coordinates are transmitted.static enumMouse tracking protocol — controls which events are reported. -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddisable(Appendable out, MouseTracking.Protocol protocol) Disables a mouse tracking protocol.static voiddisableEncoding(Appendable out, MouseTracking.Encoding encoding) Disables a mouse coordinate encoding.static voidenable(Appendable out, MouseTracking.Protocol protocol) Enables a mouse tracking protocol.static voidenableEncoding(Appendable out, MouseTracking.Encoding encoding) Enables a mouse coordinate encoding.
-
Method Details
-
enable
Enables a mouse tracking protocol.- Parameters:
out- the output to write the escape sequence toprotocol- the protocol to enable- Throws:
IOException- if writing fails
-
disable
Disables a mouse tracking protocol.- Parameters:
out- the output to write the escape sequence toprotocol- the protocol to disable- Throws:
IOException- if writing fails
-
enableEncoding
public static void enableEncoding(Appendable out, MouseTracking.Encoding encoding) throws IOException Enables a mouse coordinate encoding.- Parameters:
out- the output to write the escape sequence toencoding- the encoding to enable- Throws:
IOException- if writing fails
-
disableEncoding
public static void disableEncoding(Appendable out, MouseTracking.Encoding encoding) throws IOException Disables a mouse coordinate encoding.- Parameters:
out- the output to write the escape sequence toencoding- the encoding to disable- Throws:
IOException- if writing fails
-