successfully registers the first combo input, but then after releasing and pressing again it still doesn't work.
Adding a flag to an AND of isPressed like:
again successfully registers the first combo input, and then messes up the second. In this configuration it prematurely fires the "CMD+Z" even when only the "CMD" is depressed. When checking multiple hotkeys (like both UNDO and REDO) after they've both registered correctly once, they will thereafter both fire at the same time whenever CMD is hit all by itself (canceling each other out in this instance).
Further testing by logging the state of Keyb.data["Z"] on the above code snippet reports that Keyb thinks the Z key is still depressed even when hitting only the CMD key:
I reproduced this bug! For whatever reason, the browser does not trigger the keyup event of a key if you follow it by or . The keyup event for and will trigger, but not the key you pressed before it.
For example, the check for an undo hotkey:
if(Keyb.isPressed("<meta>") && Keyb.wasJustPressed("Z"))
successfully registers the first combo input, but then after releasing and pressing again it still doesn't work. Adding a flag to an AND of isPressed like:
if((Keyb.isPressed("<control>") || Keyb.isPressed("<meta>")) && Keyb.isPressed("Z")) { if(this.hasJustUndone == false) { console.log("UN") this.hasJustUndone = true this.loadProtoUnitsToUndo() } } else { this.hasJustUndone = false }
again successfully registers the first combo input, and then messes up the second. In this configuration it prematurely fires the "CMD+Z" even when only the "CMD" is depressed. When checking multiple hotkeys (like both UNDO and REDO) after they've both registered correctly once, they will thereafter both fire at the same time whenever CMD is hit all by itself (canceling each other out in this instance).
Further testing by logging the state of
Keyb.data["Z"]
on the above code snippet reports that Keyb thinks the Z key is still depressed even when hitting only the CMD key: