2016-06-28 01:26:00 +03:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
2019-09-27 18:26:14 +03:00
|
|
|
[Pref="dom.gamepad.test.enabled",
|
|
|
|
Exposed=Window]
|
2016-06-28 01:26:00 +03:00
|
|
|
interface GamepadServiceTest
|
|
|
|
{
|
2016-12-09 01:59:06 +03:00
|
|
|
readonly attribute GamepadMappingType noMapping;
|
|
|
|
readonly attribute GamepadMappingType standardMapping;
|
2017-02-02 10:00:51 +03:00
|
|
|
readonly attribute GamepadHand noHand;
|
|
|
|
readonly attribute GamepadHand leftHand;
|
|
|
|
readonly attribute GamepadHand rightHand;
|
2016-06-28 01:26:00 +03:00
|
|
|
|
|
|
|
[Throws]
|
|
|
|
Promise<unsigned long> addGamepad(DOMString id,
|
2016-12-09 01:59:06 +03:00
|
|
|
GamepadMappingType mapping,
|
2017-02-02 10:00:51 +03:00
|
|
|
GamepadHand hand,
|
2016-06-28 01:26:00 +03:00
|
|
|
unsigned long numButtons,
|
2017-02-02 10:00:51 +03:00
|
|
|
unsigned long numAxes,
|
2019-05-30 01:15:25 +03:00
|
|
|
unsigned long numHaptics,
|
|
|
|
unsigned long numLightIndicator,
|
|
|
|
unsigned long numTouchEvents);
|
2016-06-28 01:26:00 +03:00
|
|
|
|
|
|
|
void removeGamepad(unsigned long index);
|
|
|
|
|
|
|
|
void newButtonEvent(unsigned long index,
|
|
|
|
unsigned long button,
|
2017-04-06 13:36:46 +03:00
|
|
|
boolean pressed,
|
|
|
|
boolean touched);
|
2016-06-28 01:26:00 +03:00
|
|
|
|
|
|
|
void newButtonValueEvent(unsigned long index,
|
|
|
|
unsigned long button,
|
|
|
|
boolean pressed,
|
2017-04-06 13:36:46 +03:00
|
|
|
boolean touched,
|
2016-06-28 01:26:00 +03:00
|
|
|
double value);
|
|
|
|
|
|
|
|
void newAxisMoveEvent(unsigned long index,
|
|
|
|
unsigned long axis,
|
|
|
|
double value);
|
2017-02-02 10:00:51 +03:00
|
|
|
void newPoseMove(unsigned long index,
|
|
|
|
Float32Array? orient,
|
|
|
|
Float32Array? pos,
|
|
|
|
Float32Array? angVelocity,
|
|
|
|
Float32Array? angAcceleration,
|
|
|
|
Float32Array? linVelocity,
|
|
|
|
Float32Array? linAcceleration);
|
2019-05-30 01:15:25 +03:00
|
|
|
|
|
|
|
void newTouch(unsigned long index, unsigned long aTouchArrayIndex,
|
|
|
|
unsigned long touchId, octet surfaceId,
|
|
|
|
Float32Array position, Float32Array? surfaceDimension);
|
2016-06-28 01:26:00 +03:00
|
|
|
};
|