Mercurial > hg > webaudioevaluationtool
comparison js/core.js @ 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 | a504a17dcf9f 2e8bf9499e92 |
children | 385bb2e03ab7 |
comparison
equal
deleted
inserted
replaced
3085:1ff68ea1a4cf | 3087:39ffb48949de |
---|---|
2427 }); | 2427 }); |
2428 if (index >= 0) { | 2428 if (index >= 0) { |
2429 audioEngineContext.play(this.keys[index].audioObject.id); | 2429 audioEngineContext.play(this.keys[index].audioObject.id); |
2430 } | 2430 } |
2431 } | 2431 } |
2432 | |
2433 function trackCommentFocus() { | |
2434 return document.activeElement.className.indexOf("trackComment") >= 0; | |
2435 } | |
2432 if (e.key === " ") { | 2436 if (e.key === " ") { |
2433 if (isPlaying()) { | 2437 if (isPlaying() && trackCommentFocus() == false) { |
2438 e.preventDefault(); | |
2434 audioEngineContext.stop(); | 2439 audioEngineContext.stop(); |
2435 } | 2440 } |
2436 } else { | 2441 } else { |
2437 keypress.call(this, e.key); | 2442 keypress.call(this, e.key); |
2438 } | 2443 } |
2444 console.log(e); | |
2439 } | 2445 } |
2440 }; | 2446 }; |
2441 document.addEventListener("keydown", keyboardInterfaceController, false); | 2447 document.addEventListener("keydown", keyboardInterfaceController, false); |
2442 return keyboardInterfaceController; | 2448 return keyboardInterfaceController; |
2443 })(); | 2449 })(); |