Ignore keypress if in input box
This commit is contained in:
parent
4d9de7652b
commit
52d667feec
1 changed files with 30 additions and 26 deletions
|
|
@ -129,6 +129,9 @@ addEventListener("keydown", function (e) {
|
||||||
keysDown[e.keyCode] = true; //Add key to array
|
keysDown[e.keyCode] = true; //Add key to array
|
||||||
console.log(keysDown)
|
console.log(keysDown)
|
||||||
|
|
||||||
|
// If not currently in an input box
|
||||||
|
if (!(e.target instanceof HTMLInputElement)) {
|
||||||
|
|
||||||
// If stage movement keys are pressed
|
// If stage movement keys are pressed
|
||||||
if ((leftKeyID in keysDown) || (rightKeyID in keysDown) || (upKeyID in keysDown) || (downKeyID in keysDown) || (pgupKeyID in keysDown) || (pgdnKeyID in keysDown)) {
|
if ((leftKeyID in keysDown) || (rightKeyID in keysDown) || (upKeyID in keysDown) || (downKeyID in keysDown) || (pgupKeyID in keysDown) || (pgdnKeyID in keysDown)) {
|
||||||
// Calculate movement array
|
// Calculate movement array
|
||||||
|
|
@ -157,6 +160,7 @@ addEventListener("keydown", function (e) {
|
||||||
// Make a position request
|
// Make a position request
|
||||||
moveStagePositions(x_rel, y_rel, z_rel)
|
moveStagePositions(x_rel, y_rel, z_rel)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}, false);
|
}, false);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue