Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(480)

Unified Diff: samples/pingpong/o3dPingPong.html

Issue 155872: Fix for keys not working when plugin has focus in pingpong sample.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/o3d/
Patch Set: '' Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/pingpong/o3dPingPong.html
===================================================================
--- samples/pingpong/o3dPingPong.html (revision 21185)
+++ samples/pingpong/o3dPingPong.html (working copy)
@@ -520,24 +520,13 @@
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;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698