Class: Rubygame::KeyUpEvent
- Defined in:
- lib/rubygame/event.rb,
ext/rubygame/rubygame_event.c
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.
119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/rubygame/event.rb', line 119 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.
118 119 120 |
# File 'lib/rubygame/event.rb', line 118 def key @key end |
#mods ⇒ Object
Returns the value of attribute mods.
118 119 120 |
# File 'lib/rubygame/event.rb', line 118 def mods @mods end |
#string ⇒ Object
Returns the value of attribute string.
118 119 120 |
# File 'lib/rubygame/event.rb', line 118 def string @string end |