module BBS::Telnet::Mouse
xterm mouse reporting of a telnet line: turning it on and off, and decoding its reports into a MouseEvent (Telnet::Keys reads them).
Constants
- MOUSE_BUTTONS
-
The buttons by the value of
MOUSE_BUTTON_BITS; any other is:none. - MOUSE_BUTTON_BITS
-
The bits of a mouse report that tell the button.
- MOUSE_MODIFIERS
-
The modifier bits of a mouse report and the modifiers they tell.
- MOUSE_MOTION
-
Mousereport bit: the mouse moved with a button held. - MOUSE_OFF
-
Turns every xterm mouse reporting mode
enable_mousemay leave on off. - MOUSE_ON
-
Turns xterm mouse reporting on: button events with drags (1002) in SGR coordinates (1006).
- MOUSE_PRESS
-
The final byte of an X10 mouse report,
ESC [ M b x y, and of an SGR mouse press. - MOUSE_RELEASE
-
The final byte of an SGR mouse release.
- MOUSE_WHEEL
-
Mousereport bit: a wheel turn; button 0 is up, 1 is down. - MouseEvent
-
A decoded mouse report.
- kind
-
:press,:release,:move(motion with a button held) or:wheel - button
-
:left,:middle,:rightor:none; for:wheel,:upor:down - x, y
-
1-based terminal column and row
- mods
-
Array of the modifiers held:
:shift,:meta,:ctrl
- SGR_MOUSE
-
The parameter prefix of an SGR mouse report,
ESC [ < b ; x ; y. - SGR_MOUSE_FIELDS
-
The number of fields of an SGR mouse report: button, x, y.
- X10_OFFSET
-
Added to each byte of an X10 mouse report.
- X10_RELEASE
-
The button value of an X10 release report (no button).
Public Instance Methods
Source
# File lib/bbs/telnet/mouse.rb, line 57 def disable_mouse return unless @mouse_enabled write MOUSE_OFF @mouse_enabled = false end
Turns xterm mouse reporting off, if enable_mouse turned it on.
Source
# File lib/bbs/telnet/mouse.rb, line 49 def enable_mouse return if @mouse_enabled || @petscii write MOUSE_ON @mouse_enabled = true end
Turns on xterm mouse reporting by writing MOUSE_ON. Does nothing when it is already on or the line is in PETSCII mode.