Mercurial > hg > webaudioevaluationtool
changeset 3087:39ffb48949de
Merge branch 'vnext' into Dev_main
author | Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk> |
---|---|
date | Tue, 09 Jan 2018 16:27:56 +0000 |
parents | 1ff68ea1a4cf (current diff) 2e8bf9499e92 (diff) |
children | 12b90c6ff910 |
files | js/core.js |
diffstat | 1 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/js/core.js Tue Jan 09 16:13:40 2018 +0000 +++ b/js/core.js Tue Jan 09 16:27:56 2018 +0000 @@ -2429,13 +2429,19 @@ audioEngineContext.play(this.keys[index].audioObject.id); } } + + function trackCommentFocus() { + return document.activeElement.className.indexOf("trackComment") >= 0; + } if (e.key === " ") { - if (isPlaying()) { + if (isPlaying() && trackCommentFocus() == false) { + e.preventDefault(); audioEngineContext.stop(); } } else { keypress.call(this, e.key); } + console.log(e); } }; document.addEventListener("keydown", keyboardInterfaceController, false);