MouseEvent.hx 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. /*
  2. * Copyright (C)2005-2019 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. The X coordinate of the mouse pointer in global (screen) coordinates.
  33. **/
  34. var screenX(default,null) : Int;
  35. /**
  36. The Y coordinate of the mouse pointer in global (screen) coordinates.
  37. **/
  38. var screenY(default,null) : Int;
  39. /**
  40. The X coordinate of the mouse pointer in local (DOM content) coordinates.
  41. **/
  42. var clientX(default,null) : Int;
  43. /**
  44. The Y coordinate of the mouse pointer in local (DOM content) coordinates.
  45. **/
  46. var clientY(default,null) : Int;
  47. /**
  48. Alias for `MouseEvent.clientX`.
  49. **/
  50. var x(default,null) : Int;
  51. /**
  52. Alias for `MouseEvent.clientY`
  53. **/
  54. var y(default,null) : Int;
  55. /**
  56. The X coordinate of the mouse pointer relative to the position of the padding edge of the target node.
  57. **/
  58. var offsetX(default,null) : Int;
  59. /**
  60. The Y coordinate of the mouse pointer relative to the position of the padding edge of the target node.
  61. **/
  62. var offsetY(default,null) : Int;
  63. /**
  64. Returns `true` if the control key was down when the mouse event was fired.
  65. **/
  66. var ctrlKey(default,null) : Bool;
  67. /**
  68. Returns `true` if the shift key was down when the mouse event was fired.
  69. **/
  70. var shiftKey(default,null) : Bool;
  71. /**
  72. Returns `true` if the alt key was down when the mouse event was fired.
  73. **/
  74. var altKey(default,null) : Bool;
  75. /**
  76. Returns `true` if the meta key was down when the mouse event was fired.
  77. **/
  78. var metaKey(default,null) : Bool;
  79. /**
  80. The button number that was pressed (if applicable) when the mouse event was fired.
  81. **/
  82. var button(default,null) : Int;
  83. /**
  84. The buttons being depressed (if any) when the mouse event was fired.
  85. **/
  86. var buttons(default,null) : Int;
  87. /**
  88. The secondary target for the event, if there is one.
  89. **/
  90. var relatedTarget(default,null) : EventTarget;
  91. /**
  92. Returns the id of the hit region affected by the event. If no hit region is affected, `null` is returned.
  93. **/
  94. var region(default,null) : String;
  95. /**
  96. The X coordinate of the mouse pointer relative to the position of the last `mousemove` event.
  97. **/
  98. var movementX(default,null) : Int;
  99. /**
  100. The Y coordinate of the mouse pointer relative to the position of the last `mousemove` event.
  101. **/
  102. var movementY(default,null) : Int;
  103. /** @throws DOMError */
  104. function new( typeArg : String, ?mouseEventInitDict : MouseEventInit ) : Void;
  105. /**
  106. Initializes the value of a `MouseEvent` created. If the event has already being dispatched, this method does nothing.
  107. **/
  108. function initMouseEvent( typeArg : String, canBubbleArg : Bool = false, cancelableArg : Bool = false, ?viewArg : Window, detailArg : Int = 0, screenXArg : Int = 0, screenYArg : Int = 0, clientXArg : Int = 0, clientYArg : Int = 0, ctrlKeyArg : Bool = false, altKeyArg : Bool = false, shiftKeyArg : Bool = false, metaKeyArg : Bool = false, buttonArg : Int = 0, ?relatedTargetArg : EventTarget ) : Void;
  109. /**
  110. Returns the current state of the specified modifier key. See the `KeyboardEvent.getModifierState`() for details.
  111. **/
  112. function getModifierState( keyArg : String ) : Bool;
  113. function initNSMouseEvent( typeArg : String, canBubbleArg : Bool = false, cancelableArg : Bool = false, ?viewArg : Window, detailArg : Int = 0, screenXArg : Int = 0, screenYArg : Int = 0, clientXArg : Int = 0, clientYArg : Int = 0, ctrlKeyArg : Bool = false, altKeyArg : Bool = false, shiftKeyArg : Bool = false, metaKeyArg : Bool = false, buttonArg : Int = 0, ?relatedTargetArg : EventTarget, pressure : Float = 0.0, inputSourceArg : Int = 0 ) : Void;
  114. }