Class: Browser::Event::Gamepad

Inherits:
Browser::Event show all
Defined in:
opal/browser/event/gamepad.rb

Defined Under Namespace

Classes: Definition

Instance Attribute Summary

Attributes inherited from Browser::Event

#callback, #on

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Browser::Event

aliases, #arguments, #arguments=, class_for, create, handlers, handles, #initialize, #name, name_for, new, #off, #prevent, #prevented?, #stop, #stop!, #stopped?, #target

Constructor Details

This class inherits a constructor from Browser::Event

Class Method Details

.construct(name, desc) ⇒ Object



35
36
37
38
39
40
# File 'opal/browser/event/gamepad.rb', line 35

def self.construct(name, desc)
  `return new GamepadEvent(#{name}, {
    bubbles:    desc.bubbles,
    cancelable: desc.cancelable,
    gamepad:    desc })`
end

.supported?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'opal/browser/event/gamepad.rb', line 8

def self.supported?
  Browser.supports? 'Event.Gamepad'
end

Instance Method Details

#atObject



51
52
53
# File 'opal/browser/event/gamepad.rb', line 51

def at
  `#@native.gamepad.timestamp`
end

#axesObject



55
56
57
# File 'opal/browser/event/gamepad.rb', line 55

def axes
  `#@native.gamepad.axes`
end

#buttonsObject



59
60
61
# File 'opal/browser/event/gamepad.rb', line 59

def buttons
  `#@native.gamepad.buttons`
end

#idObject



43
44
45
# File 'opal/browser/event/gamepad.rb', line 43

def id
  `#@native.gamepad.id`
end

#indexObject



47
48
49
# File 'opal/browser/event/gamepad.rb', line 47

def index
  `#@native.gamepad.index`
end