1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-03-02 03:39:21 +00:00

use MouseEvent in keyboard hooks

This commit is contained in:
Dimava
2020-05-30 10:56:23 +03:00
parent da94d5264a
commit e58c2fd371
2 changed files with 22 additions and 14 deletions

View File

@@ -442,6 +442,8 @@ export class Camera extends BasicSerializableObject {
this.downPreHandler.dispatch(new Vector(event.clientX, event.clientY), enumMouseButton.middle);
} else if (event.button === 2) {
this.downPreHandler.dispatch(new Vector(event.clientX, event.clientY), enumMouseButton.right);
} else {
this.root.app.inputMgr.handleKeydown(event);
}
return false;
}
@@ -484,6 +486,9 @@ export class Camera extends BasicSerializableObject {
if (!this.checkPreventDoubleMouse()) {
return;
}
if (event.button >= 3) {
this.root.app.inputMgr.handleKeyup(event);
}
this.combinedSingleTouchStopHandler(event.clientX, event.clientY);
return false;