mirror of
https://github.com/tobspr/shapez.io.git
synced 2024-10-27 20:34:29 +00:00
replace MouseEvent.which with MouseEvent.button
This commit is contained in:
parent
88a1c733bd
commit
da94d5264a
@ -311,7 +311,7 @@ export class ClickDetector {
|
||||
const position = /** @type {typeof ClickDetector} */ (this.constructor).extractPointerPosition(event);
|
||||
|
||||
if (event instanceof MouseEvent) {
|
||||
const isRightClick = event.which == 3;
|
||||
const isRightClick = event.button === 2;
|
||||
if (isRightClick) {
|
||||
// Ignore right clicks
|
||||
this.rightClick.dispatch(position, event);
|
||||
@ -384,7 +384,7 @@ export class ClickDetector {
|
||||
}
|
||||
|
||||
if (event instanceof MouseEvent) {
|
||||
const isRightClick = event.which == 3;
|
||||
const isRightClick = event.button === 2;
|
||||
if (isRightClick) {
|
||||
return;
|
||||
}
|
||||
|
@ -436,11 +436,11 @@ export class Camera extends BasicSerializableObject {
|
||||
}
|
||||
|
||||
this.touchPostMoveVelocity = new Vector(0, 0);
|
||||
if (event.which === 1) {
|
||||
if (event.button === 0) {
|
||||
this.combinedSingleTouchStartHandler(event.clientX, event.clientY);
|
||||
} else if (event.which === 2) {
|
||||
} else if (event.button === 1) {
|
||||
this.downPreHandler.dispatch(new Vector(event.clientX, event.clientY), enumMouseButton.middle);
|
||||
} else if (event.which === 3) {
|
||||
} else if (event.button === 2) {
|
||||
this.downPreHandler.dispatch(new Vector(event.clientX, event.clientY), enumMouseButton.right);
|
||||
}
|
||||
return false;
|
||||
@ -460,7 +460,7 @@ export class Camera extends BasicSerializableObject {
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.which === 1) {
|
||||
if (event.button === 0) {
|
||||
this.combinedSingleTouchMoveHandler(event.clientX, event.clientY);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user