Class: Rubygame::KeyUpEvent
Overview
Indicates that a keyboard key was released.
See KeyDownEvent.
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
-
#mods ⇒ Object
Returns the value of attribute mods.
-
#string ⇒ Object
Returns the value of attribute string.
Instance Method Summary collapse
-
#initialize(key, mods) ⇒ KeyUpEvent
constructor
A new instance of KeyUpEvent.
Constructor Details
#initialize(key, mods) ⇒ KeyUpEvent
Returns a new instance of KeyUpEvent.
227 228 229 230 231 232 233 234 235 236 237 238 239 240 |
# File 'lib/rubygame/event.rb', line 227 def initialize(key,mods) if key.kind_of? Integer @key = key @string = Rubygame.key2str(key, mods) #a string or nil elsif key.kind_of? String @key = Rubygame::Key::ASCII2KEY[key] if @key != nil @string = key else raise(ArgumentError,"First argument of KeyUpEvent.new() must be an Integer KeySym (like K_A) or a ASCII-like String (like \"a\" or \"A\"). Got %s (%s)"%[key,key.class]) end end @mods = mods end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
226 227 228 |
# File 'lib/rubygame/event.rb', line 226 def key @key end |
#mods ⇒ Object
Returns the value of attribute mods.
226 227 228 |
# File 'lib/rubygame/event.rb', line 226 def mods @mods end |
#string ⇒ Object
Returns the value of attribute string.
226 227 228 |
# File 'lib/rubygame/event.rb', line 226 def string @string end |