michael@0: /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: [Pref="dom.gamepad.enabled"] michael@0: interface GamepadButton { michael@0: readonly attribute boolean pressed; michael@0: readonly attribute double value; michael@0: }; michael@0: michael@0: [Pref="dom.gamepad.enabled"] michael@0: interface Gamepad { michael@0: /** michael@0: * An identifier, unique per type of device. michael@0: */ michael@0: readonly attribute DOMString id; michael@0: michael@0: /** michael@0: * The game port index for the device. Unique per device michael@0: * attached to this system. michael@0: */ michael@0: readonly attribute unsigned long index; michael@0: michael@0: /** michael@0: * The mapping in use for this device. The empty string michael@0: * indicates that no mapping is in use. michael@0: */ michael@0: readonly attribute DOMString mapping; michael@0: michael@0: /** michael@0: * true if this gamepad is currently connected to the system. michael@0: */ michael@0: readonly attribute boolean connected; michael@0: michael@0: /** michael@0: * The current state of all buttons on the device, an michael@0: * array of GamepadButton. michael@0: */ michael@0: [Pure, Cached, Frozen] michael@0: readonly attribute sequence buttons; michael@0: michael@0: /** michael@0: * The current position of all axes on the device, an michael@0: * array of doubles. michael@0: */ michael@0: [Pure, Cached, Frozen] michael@0: readonly attribute sequence axes; michael@0: };