dom/webidl/Gamepad.webidl

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     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