comparison js/core.js @ 2965:31a7a34bad6b

Fix #264
author Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk>
date Tue, 09 Jan 2018 16:27:28 +0000
parents 8fa0f2a59b6d
children f82cda734a1e 2e8bf9499e92
comparison
equal deleted inserted replaced
2964:7bbab5127538 2965:31a7a34bad6b
2418 }); 2418 });
2419 if (index >= 0) { 2419 if (index >= 0) {
2420 audioEngineContext.play(this.keys[index].audioObject.id); 2420 audioEngineContext.play(this.keys[index].audioObject.id);
2421 } 2421 }
2422 } 2422 }
2423
2424 function trackCommentFocus() {
2425 return document.activeElement.className.indexOf("trackComment") >= 0;
2426 }
2423 if (e.key === " ") { 2427 if (e.key === " ") {
2424 if (isPlaying()) { 2428 if (isPlaying() && trackCommentFocus() == false) {
2429 e.preventDefault();
2425 audioEngineContext.stop(); 2430 audioEngineContext.stop();
2426 } 2431 }
2427 } else { 2432 } else {
2428 keypress.call(this, e.key); 2433 keypress.call(this, e.key);
2429 } 2434 }
2435 console.log(e);
2430 } 2436 }
2431 }; 2437 };
2432 document.addEventListener("keydown", keyboardInterfaceController, false); 2438 document.addEventListener("keydown", keyboardInterfaceController, false);
2433 return keyboardInterfaceController; 2439 return keyboardInterfaceController;
2434 })(); 2440 })();