diff options
-rw-r--r-- | o3d/samples/pingpong/o3dPingPong.html | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/o3d/samples/pingpong/o3dPingPong.html b/o3d/samples/pingpong/o3dPingPong.html index dea886e..a487166 100644 --- a/o3d/samples/pingpong/o3dPingPong.html +++ b/o3d/samples/pingpong/o3dPingPong.html @@ -520,24 +520,13 @@ window.onunload = uninit; keyIsDown = new Array(); document.onkeydown = function(e) { - var keycode; - if (window.event) { - keycode = window.event.keyCode; - } else if (e) { - keycode = e.which; - } - keyIsDown[keycode] = true; + var keyChar = o3djs.event.getEventKeyChar(e); + keyIsDown[keyChar] = true; } document.onkeyup = function(e) { - var keycode; - if (window.event) { - keycode = window.event.keyCode; - } else if (e) { - keycode = e.which; - } - keyIsDown[keycode] = false; - + var keyChar = o3djs.event.getEventKeyChar(e); + keyIsDown[keyChar] = false; } |