Class: Rubydraw::Events::KeyboardEvent
- Defined in:
- lib/rubydraw/events.rb
Overview
Provides methods used in both Rubydraw::Events::KeyPressed and Rubydraw::Events::KeyReleased. No instances of this class should be created, but instances of subclasses are fine.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(key) ⇒ KeyboardEvent
constructor
A new instance of KeyboardEvent.
Methods inherited from Event
#event?, matches?, matching_sdl_type
Constructor Details
#initialize(key) ⇒ KeyboardEvent
Returns a new instance of KeyboardEvent.
95 96 97 |
# File 'lib/rubydraw/events.rb', line 95 def initialize(key) @key = key end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
93 94 95 |
# File 'lib/rubydraw/events.rb', line 93 def key @key end |
Class Method Details
.from_sdl_event(sdl_event) ⇒ Object
89 90 91 |
# File 'lib/rubydraw/events.rb', line 89 def self.from_sdl_event(sdl_event) self.new(sdl_event.keysym.sym) end |
.wants_to_match? ⇒ Boolean
85 86 87 |
# File 'lib/rubydraw/events.rb', line 85 def self.wants_to_match? false end |