Class: Tea::Kbd::Up
Overview
Event generated when a held-down key is released. key and mods are the same as in KeyDown.
key-
Physical key that was pressed, as a symbol (see key reference).
mods-
Hash of the active key modifiers. Values are
trueorfalse, and the keys can be::L_SHIFT,:R_SHIFT,:L_CTRL,:R_CTRL,:L_ALT,:R_ALT,:NUM_LOCK,:CAPS_LOCK,:ALT_GR. Also,:SHIFT,:CTRLand:ALTare provided for convenience, and Tea key constants with the same names can be used instead.
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#mods ⇒ Object
readonly
Returns the value of attribute mods.
Instance Method Summary collapse
-
#initialize(sdl_event) ⇒ Up
constructor
A new instance of Up.
Methods inherited from Event
Constructor Details
#initialize(sdl_event) ⇒ Up
Returns a new instance of Up.
226 227 228 229 |
# File 'lib/tea/m_event_keyboard.rb', line 226 def initialize(sdl_event) @key = sdl_keysym_to_key(sdl_event.sym) @mods = sdl_keymod_to_mods(sdl_event.mod) end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
225 226 227 |
# File 'lib/tea/m_event_keyboard.rb', line 225 def key @key end |
#mods ⇒ Object (readonly)
Returns the value of attribute mods.
225 226 227 |
# File 'lib/tea/m_event_keyboard.rb', line 225 def mods @mods end |