jsketcher/web/test/utils/mouse-event.js
2016-12-26 14:03:14 -08:00

20 lines
520 B
JavaScript

export function TestMouseEvent(x, y, type) {
this.type = type ? type : 'click';
this.canBubble = true;
this.cancelable = true;
this.detail = 1;
this.screenX = x;
this.screenY = y;
this.clientX = this.screenX;
this.clientY = this.screenY;
this.pageX = this.screenX;
this.pageY = this.screenY;
this.offsetX = this.screenX;
this.offsetY = this.screenY;
this.ctrlKey = false;
this.altKey = false;
this.shiftKey = false;
this.metaKey = false;
this.button = 0;
this.relatedTarget = null;
}