Class: RAGE::InputHandler
- Inherits:
-
Object
- Object
- RAGE::InputHandler
- Defined in:
- lib/rage/input.rb
Overview
Handles and redirects user events to registered callbacks.
Class Method Summary collapse
- .<<(handler) ⇒ Object
- .clear ⇒ Object
-
.handle(event) ⇒ Object
Invoked during main game execution cycle to handle any SDL input events.
Class Method Details
.<<(handler) ⇒ Object
13 14 15 16 |
# File 'lib/rage/input.rb', line 13 def self.<<(handler) set_defaults @@handlers << handler end |
.clear ⇒ Object
18 19 20 21 |
# File 'lib/rage/input.rb', line 18 def self.clear set_defaults @@handlers.clear end |
.handle(event) ⇒ Object
Invoked during main game execution cycle to handle any SDL input events
24 25 26 27 |
# File 'lib/rage/input.rb', line 24 def self.handle(event) set_defaults @@handlers.each { |h| h.handle(event) } end |