My code is as follows:
var map = []; document.body.onkeydown = document.body.onkeyup = function(e){ e = e || event; // to deal with IE map[e.key] = e.type ==