Space Invaders works on the desktop now

This commit is contained in:
Jeff Parsons 2016-05-14 23:12:39 -07:00
commit f09189c121
9 changed files with 269 additions and 116 deletions

View file

@ -245,6 +245,16 @@ Video.prototype.initBus = function(cmp, bus, cpu, dbg)
this.nPixelsPerCell = (16 / this.nBitsPerPixel)|0;
this.initCache();
}
/*
* If we have an associated keyboard, then ensure that the keyboard will be notified whenever the canvas
* gets focus and receives input.
*/
this.kbd = cmp.getMachineComponent("Keyboard");
if (this.kbd && this.canvasScreen) {
this.kbd.setBinding(this.textareaScreen? "textarea" : "canvas", "kbd", this.inputScreen);
}
this.setReady();
};