From 9038ac8a1a0edd038bdbb52bbaf274bac7930b03 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Mon, 9 Jul 2012 23:34:17 -0500 Subject: [PATCH] fix keybindings in IE --- scoreboard.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/scoreboard.js b/scoreboard.js index 653d557..5a8c808 100644 --- a/scoreboard.js +++ b/scoreboard.js @@ -376,10 +376,9 @@ function handle(event) { transition(newstate); } -// I'm unable to get IE8 to ever call this on a key press. -// You guys are just going to have to use the mouse. function key(event) { - var c = String.fromCharCode(event.which || 0); + var e = event || window.event; + var c = String.fromCharCode(e.which || e.keyCode || 0); var newstate; switch (c) { @@ -536,6 +535,5 @@ function resize() { } window.onload = start; -window.onkeypress = key; +document.onkeypress = key; // IE requires document, not window window.onresize = resize; -