Ending selector, VN sequences
This commit is contained in:
@ -111,6 +111,16 @@ class Input {
|
||||
isKeyReleased(key: string) : boolean {
|
||||
return !this.#keyDown[key] && this.#previousKeyDown[key];
|
||||
}
|
||||
|
||||
isAnythingPressed(): boolean {
|
||||
for (let k of Object.keys(this.#keyDown)) {
|
||||
if (this.#keyDown[k] && !this.#previousKeyDown[k]) { return true }
|
||||
}
|
||||
for (let k of Object.keys(this.#mouseDown)) {
|
||||
if (this.#mouseDown[k] && !this.#previousMouseDown[k]) { return true }
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
let active = new Input();
|
||||
|
Reference in New Issue
Block a user