update so that keyboard and midi both trigger

This commit is contained in:
harmse 2018-08-08 14:06:27 -04:00
parent 896d778dee
commit 0afc8f69f6

View File

@ -76,9 +76,6 @@ class Keyboard extends events.EventEmitter{
//the midi input
this._midi = new Midi()
this._midi.on('keyDown', (note) => {
const splash = document.getElementById("splash");
splash.classList.add('disappear');
container.classList.add('focus');
this.keyDown(note);
this._emitKeyDown(note);
});
@ -114,6 +111,9 @@ class Keyboard extends events.EventEmitter{
if (!this._active){
return
}
const splash = document.getElementById("splash");
splash.classList.add('disappear');
container.classList.add('focus');
if (!this._currentKeys[note]){
this._currentKeys[note] = 0
}