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


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

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

.supported?Boolean

Returns:

  • (Boolean)

6
7
8
# File 'opal/browser/event/gamepad.rb', line 6

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

Instance Method Details

#atObject


49
50
51
# File 'opal/browser/event/gamepad.rb', line 49

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

#axesObject


53
54
55
# File 'opal/browser/event/gamepad.rb', line 53

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

#buttonsObject


57
58
59
# File 'opal/browser/event/gamepad.rb', line 57

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

#idObject


41
42
43
# File 'opal/browser/event/gamepad.rb', line 41

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

#indexObject


45
46
47
# File 'opal/browser/event/gamepad.rb', line 45

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