TermBuf::Input::Mouse
What the terminal says the pointer did, taken out of an SGR mouse report.
SGR — DEC private mode 1006 — is the encoding worth decoding: the older
one packs the coordinates into single bytes and cannot name a column past
223, and it has no way to say which button was let go. An SGR report is
CSI < button ; column ; row M for a press and the same with a final m
for a release, all of it in decimal.
Turning the reporting on is the application's call, through whatever its
driver offers. Decoding is not: Input::Stream watches for
CSI < from the moment it is built, so a report arrives as
Events::Mouse whoever asked for it.
Constants
Alt, or meta, was held.
Control was held.
The bit that says the button field names one of buttons 8 to 11.
The bit that says the pointer moved rather than being clicked.
Shift was held.
The bit that says the button field names a wheel notch.
Class methods
What happened. The final byte separates a press from a release, and the motion bit turns a press into a drag.
Which button code names.
The button lives in the low two bits, and one of two flags above them says which set of four to read them against: the wheel, buttons 8 to 11, or — with neither flag — left, middle, right and none.
What sequence says the pointer did, or nil if it is not an SGR
mouse report after all.
Returning nil is how a pattern says "not mine": a CSI < that is not
a report — a truncated one, a field that is not a number, a coordinate
at zero — carries on to the key decoder and arrives as
Key::Name::Unknown, which beats inventing a click nobody made.