Commit 52d667fe authored by Joel Collins's avatar Joel Collins
Browse files

Ignore keypress if in input box

parent 4d9de765
Loading
Loading
Loading
Loading
+30 −26
Original line number Diff line number Diff line
@@ -129,6 +129,9 @@ addEventListener("keydown", function (e) {
    keysDown[e.keyCode] = true; //Add key to array
    console.log(keysDown)

    // If not currently in an input box
    if (!(e.target instanceof HTMLInputElement)) {

        // 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)) {
            // Calculate movement array
@@ -157,6 +160,7 @@ addEventListener("keydown", function (e) {
            // Make a position request
            moveStagePositions(x_rel, y_rel, z_rel)
        }
    }

}, false);