Gamepad.hx 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * Copyright (C)2005-2017 Haxe Foundation
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  20. * DEALINGS IN THE SOFTWARE.
  21. */
  22. // This file is generated from mozilla\Gamepad.webidl. Do not edit!
  23. package js.html;
  24. /**
  25. The `Gamepad` interface of the Gamepad API defines an individual gamepad or other controller, allowing access to information such as button presses, axis positions, and id.
  26. Documentation [Gamepad](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/).
  27. @see <https://developer.mozilla.org/en-US/docs/Web/API/Gamepad>
  28. **/
  29. @:native("Gamepad")
  30. extern class Gamepad
  31. {
  32. /**
  33. A `DOMString` containing identifying information about the controller.
  34. **/
  35. var id(default,null) : String;
  36. /**
  37. An integer that is auto-incremented to be unique for each device currently connected to the system.
  38. **/
  39. var index(default,null) : Int;
  40. /**
  41. A string indicating whether the browser has remapped the controls on the device to a known layout.
  42. **/
  43. var mapping(default,null) : GamepadMappingType;
  44. /**
  45. A boolean indicating whether the gamepad is still connected to the system.
  46. **/
  47. var connected(default,null) : Bool;
  48. /**
  49. An array of `gamepadButton` objects representing the buttons present on the device.
  50. **/
  51. var buttons(default,null) : Array<GamepadButton>;
  52. /**
  53. An array representing the controls with axes present on the device (e.g. analog thumb sticks).
  54. **/
  55. var axes(default,null) : Array<Float>;
  56. /**
  57. A `DOMHighResTimeStamp` representing the last time the data for this gamepad was updated. Note that this property is not currently supported anywhere.
  58. **/
  59. var timestamp(default,null) : Float;
  60. }