Phosphor::MouseEvent
Inherits Phosphor::Event < Reference < Object
A mouse action (press, release, drag, or wheel) received from the terminal.
x and y are 0-based, matching Frame coordinates. modifiers is a
placeholder bitmask for Shift/Ctrl/Alt state.
Constants
MouseButton values in the order the SGR button byte's low 2 bits
encode them — index 3 ("11") is unassigned by the protocol, hence
Unknown. Only meaningful for Press/Release/Drag; wheel events
reuse these same bits for scroll direction instead.
Constructors
Class methods
Parses an SGR extended mouse sequence (\e[<Cb;Cx;CyM or \e[<Cb;Cx;Cym)
into a MouseEvent, or returns nil if bytes is not a valid SGR report.
Cx/Cy are 1-based in the wire format; subtracted by 1 here so the
resulting MouseEvent#x/#y are 0-based, matching Frame coordinates.
modifiers encodes Shift (1), Alt (2), and Ctrl (4) from the button
byte's upper bits.