MouseEvent.hx 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. /*
  2. * Copyright (C)2005-2018 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\MouseEvent.webidl. Do not edit!
  23. package js.html;
  24. /**
  25. The `MouseEvent` interface represents events that occur due to the user interacting with a pointing device (such as a mouse). Common events using this interface include `click`, `dblclick`, `mouseup`, `mousedown`.
  26. Documentation [MouseEvent](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent$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/MouseEvent>
  28. **/
  29. @:native("MouseEvent")
  30. extern class MouseEvent extends UIEvent
  31. {
  32. /**
  33. The X coordinate of the mouse pointer in global (screen) coordinates.
  34. **/
  35. var screenX(default,null) : Int;
  36. /**
  37. The Y coordinate of the mouse pointer in global (screen) coordinates.
  38. **/
  39. var screenY(default,null) : Int;
  40. /**
  41. The X coordinate of the mouse pointer in local (DOM content) coordinates.
  42. **/
  43. var clientX(default,null) : Int;
  44. /**
  45. The Y coordinate of the mouse pointer in local (DOM content) coordinates.
  46. **/
  47. var clientY(default,null) : Int;
  48. /**
  49. The X coordinate of the mouse pointer relative to the position of the padding edge of the target node.
  50. **/
  51. var offsetX(default,null) : Int;
  52. /**
  53. The Y coordinate of the mouse pointer relative to the position of the padding edge of the target node.
  54. **/
  55. var offsetY(default,null) : Int;
  56. /**
  57. Returns `true` if the control key was down when the mouse event was fired.
  58. **/
  59. var ctrlKey(default,null) : Bool;
  60. /**
  61. Returns `true` if the shift key was down when the mouse event was fired.
  62. **/
  63. var shiftKey(default,null) : Bool;
  64. /**
  65. Returns `true` if the alt key was down when the mouse event was fired.
  66. **/
  67. var altKey(default,null) : Bool;
  68. /**
  69. Returns `true` if the meta key was down when the mouse event was fired.
  70. **/
  71. var metaKey(default,null) : Bool;
  72. /**
  73. The button number that was pressed when the mouse event was fired. 
  74. **/
  75. var button(default,null) : Int;
  76. /**
  77. The buttons being pressed when the mouse event was fired
  78. **/
  79. var buttons(default,null) : Int;
  80. /**
  81. The secondary target for the event, if there is one.
  82. **/
  83. var relatedTarget(default,null) : EventTarget;
  84. /**
  85. Returns the id of the hit region affected by the event. If no hit region is affected, `null` is returned.
  86. **/
  87. var region(default,null) : String;
  88. /**
  89. The X coordinate of the mouse pointer relative to the position of the last `mousemove` event.
  90. **/
  91. var movementX(default,null) : Int;
  92. /**
  93. The Y coordinate of the mouse pointer relative to the position of the last `mousemove` event.
  94. **/
  95. var movementY(default,null) : Int;
  96. /** @throws DOMError */
  97. function new( typeArg : String, ?mouseEventInitDict : MouseEventInit ) : Void;
  98. /**
  99. Initializes the value of a `MouseEvent` created. If the event has already being dispatched, this method does nothing.
  100. **/
  101. function initMouseEvent( typeArg : String, canBubbleArg : Bool, cancelableArg : Bool, viewArg : Window, detailArg : Int, screenXArg : Int, screenYArg : Int, clientXArg : Int, clientYArg : Int, ctrlKeyArg : Bool, altKeyArg : Bool, shiftKeyArg : Bool, metaKeyArg : Bool, buttonArg : Int, relatedTargetArg : EventTarget ) : Void;
  102. /**
  103. Returns the current state of the specified modifier key. See the `KeyboardEvent.getModifierState`() for details.
  104. **/
  105. function getModifierState( keyArg : String ) : Bool;
  106. function initNSMouseEvent( typeArg : String, canBubbleArg : Bool, cancelableArg : Bool, viewArg : Window, detailArg : Int, screenXArg : Int, screenYArg : Int, clientXArg : Int, clientYArg : Int, ctrlKeyArg : Bool, altKeyArg : Bool, shiftKeyArg : Bool, metaKeyArg : Bool, buttonArg : Int, relatedTargetArg : EventTarget, pressure : Float, inputSourceArg : Int ) : Void;
  107. }