changeset 3119:aa4503f8c630

#283. Will only trigger keydown IF current state is in test
author Nicholas Jillings <nicholas.jillings@mail.bcu.ac.uk>
date Wed, 18 Jul 2018 16:32:44 +0100
parents f78a66fbc018
children 53d701288da5 a8455b0766cd
files js/core.js
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/js/core.js	Wed Jul 18 14:47:14 2018 +0100
+++ b/js/core.js	Wed Jul 18 16:32:44 2018 +0100
@@ -2452,6 +2452,9 @@
                 function trackCommentFocus() {
                     return document.activeElement.className.indexOf("trackComment") >= 0;
                 }
+                if (testState.currentStatePosition != "test") {
+                    return;
+                }
                 if (trackCommentFocus()) {
                     return;
                 }
@@ -2463,7 +2466,6 @@
                 } else {
                     keypress.call(this, e.key);
                 }
-                console.log(e);
             }
         };
         document.addEventListener("keydown", keyboardInterfaceController, false);