diff options
author | apatrick@google.com <apatrick@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-21 20:26:16 +0000 |
---|---|---|
committer | apatrick@google.com <apatrick@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-21 20:26:16 +0000 |
commit | a7f06bab72bb99c9331f8771df68bf069274d511 (patch) | |
tree | 74e3b7fa564046b85ebe97281436565fac4f4c4e /o3d | |
parent | d207c182fd764ee3df9ef18380bdb2e91fd4ae12 (diff) | |
download | chromium_src-a7f06bab72bb99c9331f8771df68bf069274d511.zip chromium_src-a7f06bab72bb99c9331f8771df68bf069274d511.tar.gz chromium_src-a7f06bab72bb99c9331f8771df68bf069274d511.tar.bz2 |
Fix for keys not working when plugin has focus in pingpong sample.
http://code.google.com/p/o3d/issues/detail?id=67
Review URL: http://codereview.chromium.org/155872
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21208 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d')
-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; } |