Termisu::Input::Modifier
Inherits Enum < Comparable < Value < Object
Keyboard modifier flags for input events.
Modifiers can be combined using bitwise OR (|). XTerm encodes modifiers as: code = 1 + (shift1 + alt2 + ctrl4 + meta8)
Example:
event = termisu.poll_event
if event.is_a?(Termisu::Event::Key)
if event.modifiers.ctrl? && event.key.lower_c?
puts "Ctrl+C pressed!"
end
end
Constants
None = 0_u8
No modifiers
Shift = 1_u8
Shift key
Alt = 2_u8
Alt/Option key
Ctrl = 4_u8
Control key
Meta = 8_u8
Meta/Super/Windows key
All = 15_u8
Constructors
Decodes mouse button modifiers from the Cb byte.
In mouse protocols, modifiers are encoded as:
- Bit 2 (4) = Shift
- Bit 3 (8) = Meta/Alt
- Bit 4 (16) = Control