JoystickAPI

From MozillaWiki
Revision as of 14:54, 2 August 2011 by Ted Mielczarek (talk | contribs) (Created page with "{{bug|604039}} covers prototyping a way for web content to receive input from Joystick/gamepad controllers connected to a computer. = Initial Implementation = The patches curren...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

bug 604039 covers prototyping a way for web content to receive input from Joystick/gamepad controllers connected to a computer.

Initial Implementation

The patches currently on the bug implement a simple set of DOM events:

  • MozJoyButtonDown
  • MozJoyButtonUp
    • These events currently have the properties:
    • unsigned long joystickID: an arbitrary integer ID that's unique per connected device
    • unsigned long button: button number being pressed/released
  • MozJoyAxisMove
    • This event currently has the properties:
    • unsigned long joystickID: an arbitrary integer ID that's unique per connected device
    • unsigned long axis: axis number being moved
    • float value: position of the axis in the range -1.0...1.0