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

Change keybinding for multi select to ctrl

This commit is contained in:
Tobias Springer
2020-05-10 18:35:27 +02:00
parent bd89c2cc9e
commit 5a61d1813a
5 changed files with 21 additions and 4 deletions

View File

@@ -25,6 +25,7 @@ export class InputDistributor {
this.shiftIsDown = false;
this.altIsDown = false;
this.ctrlIsDown = false;
this.bindToEvents();
}
@@ -175,6 +176,7 @@ export class InputDistributor {
* Handles when the page got blurred
*/
handleBlur() {
this.ctrlIsDown = false;
this.shiftIsDown = false;
this.altIsDown = false;
this.forwardToReceiver("pageBlur", {});
@@ -188,6 +190,9 @@ export class InputDistributor {
if (event.keyCode === 16) {
this.shiftIsDown = true;
}
if (event.keyCode === 17) {
this.ctrlIsDown = true;
}
if (event.keyCode === 18) {
this.altIsDown = true;
}
@@ -229,6 +234,10 @@ export class InputDistributor {
this.shiftIsDown = false;
this.forwardToReceiver("shiftUp", {});
}
if (event.keyCode === 17) {
this.ctrlIsDown = false;
this.forwardToReceiver("ctrlUp", {});
}
if (event.keyCode === 18) {
this.altIsDown = false;
this.forwardToReceiver("altUp", {});

View File

@@ -11,6 +11,7 @@ export class InputReceiver {
this.pageBlur = new Signal();
this.shiftUp = new Signal();
this.altUp = new Signal();
this.ctrlUp = new Signal();
// Dispatched on destroy
this.destroyed = new Signal();