dom/webidl/Gamepad.webidl

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 [Pref="dom.gamepad.enabled"]
     7 interface GamepadButton {
     8   readonly    attribute boolean pressed;
     9   readonly    attribute double  value;
    10 };
    12 [Pref="dom.gamepad.enabled"]
    13 interface Gamepad {
    14   /**
    15    * An identifier, unique per type of device.
    16    */
    17   readonly attribute DOMString id;
    19   /**
    20    * The game port index for the device. Unique per device
    21    * attached to this system.
    22    */
    23   readonly attribute unsigned long index;
    25   /**
    26    * The mapping in use for this device. The empty string
    27    * indicates that no mapping is in use.
    28    */
    29   readonly attribute DOMString mapping;
    31   /**
    32    * true if this gamepad is currently connected to the system.
    33    */
    34   readonly attribute boolean connected;
    36   /**
    37    * The current state of all buttons on the device, an
    38    * array of GamepadButton.
    39    */
    40   [Pure, Cached, Frozen]
    41   readonly attribute sequence<GamepadButton> buttons;
    43   /**
    44    * The current position of all axes on the device, an
    45    * array of doubles.
    46    */
    47   [Pure, Cached, Frozen]
    48   readonly attribute sequence<double> axes;
    49 };

mercurial