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, #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


31
32
33
34
35
36
# File 'opal/browser/event/gamepad.rb', line 31

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

.supported?Boolean

Returns:

  • (Boolean)

4
5
6
# File 'opal/browser/event/gamepad.rb', line 4

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

Instance Method Details

#atObject


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

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

#axesObject


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

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

#buttonsObject


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

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

#idObject


39
40
41
# File 'opal/browser/event/gamepad.rb', line 39

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

#indexObject


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

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