I\'m working on a canvas-based game and am using window.addEventListener() to attach keyup and keydown events globally. This works in
window.addEventListener()
keyup
keydown
It seems you can just do var realWindow = window.parent || window; and use addEventListener on realWindow instead.
var realWindow = window.parent || window;
realWindow