版博士V2.0程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

52 lines
1.9 KiB

  1. "use strict";
  2. var __importDefault = (this && this.__importDefault) || function (mod) {
  3. return (mod && mod.__esModule) ? mod : { "default": mod };
  4. };
  5. Object.defineProperty(exports, "__esModule", { value: true });
  6. const UIEvent_1 = __importDefault(require("../UIEvent"));
  7. /**
  8. *
  9. */
  10. class MouseEvent extends UIEvent_1.default {
  11. /**
  12. * Constructor.
  13. *
  14. * @param type Event type.
  15. * @param [eventInit] Event init.
  16. */
  17. constructor(type, eventInit = null) {
  18. super(type, eventInit);
  19. this.altKey = false;
  20. this.button = 0;
  21. this.buttons = 0;
  22. this.clientX = 0;
  23. this.clientY = 0;
  24. this.ctrlKey = false;
  25. this.metaKey = false;
  26. this.movementX = 0;
  27. this.movementY = 0;
  28. this.offsetX = 0;
  29. this.offsetY = 0;
  30. this.region = '';
  31. this.relatedTarget = null;
  32. this.screenX = 0;
  33. this.screenY = 0;
  34. this.shiftKey = false;
  35. if (eventInit) {
  36. this.altKey = eventInit.altKey || false;
  37. this.button = eventInit.button !== undefined ? eventInit.button : 0;
  38. this.buttons = eventInit.buttons !== undefined ? eventInit.buttons : 0;
  39. this.clientX = eventInit.clientX !== undefined ? eventInit.clientX : 0;
  40. this.clientY = eventInit.clientY !== undefined ? eventInit.clientY : 0;
  41. this.ctrlKey = eventInit.ctrlKey || false;
  42. this.metaKey = eventInit.metaKey || false;
  43. this.region = eventInit.region || '';
  44. this.relatedTarget = eventInit.relatedTarget || null;
  45. this.screenX = eventInit.screenX !== undefined ? eventInit.screenX : 0;
  46. this.screenY = eventInit.screenY !== undefined ? eventInit.screenY : 0;
  47. this.shiftKey = eventInit.shiftKey || false;
  48. }
  49. }
  50. }
  51. exports.default = MouseEvent;
  52. //# sourceMappingURL=MouseEvent.js.map