Class: RAGE::InputHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/rage/input.rb

Overview

Handles and redirects user events to registered callbacks.

Class Method Summary collapse

Class Method Details

.<<(handler) ⇒ Object



13
14
15
16
# File 'lib/rage/input.rb', line 13

def self.<<(handler)
  set_defaults
  @@handlers << handler
end

.clearObject



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