struct
Termisu::Event::Key
- Termisu::Event::Key
- Struct
- Value
- Object
Overview
Keyboard input event.
Contains the key pressed and any modifier keys that were held.
Example:
event = termisu.poll_event
if event.is_a?(Termisu::Event::Key)
if event.ctrl_c?
puts "Ctrl+C pressed, exiting..."
elsif event.key.escape?
puts "Escape pressed"
end
end
Defined in:
termisu/event/key.crConstructors
Instance Method Summary
-
#alt? : Bool
Returns true if Alt modifier was held.
-
#char : Char | Nil
Returns the character for this key, if printable.
-
#ctrl? : Bool
Returns true if Ctrl modifier was held.
-
#ctrl_c? : Bool
Returns true if this is Ctrl+C.
-
#ctrl_d? : Bool
Returns true if this is Ctrl+D.
-
#ctrl_q? : Bool
Returns true if this is Ctrl+Q.
-
#ctrl_z? : Bool
Returns true if this is Ctrl+Z.
-
#key : Input::Key
The key that was pressed.
-
#meta? : Bool
Returns true if Meta modifier was held.
-
#modifiers : Input::Modifier
Modifier keys held during the keypress.
-
#shift? : Bool
Returns true if Shift modifier was held.