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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!-- 1 <!--
2 Copyright 2009, Google Inc. 2 Copyright 2009, Google Inc.
3 All rights reserved. 3 All rights reserved.
4 4
5 Redistribution and use in source and binary forms, with or without 5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are 6 modification, are permitted provided that the following conditions are
7 met: 7 met:
8 8
9 * Redistributions of source code must retain the above copyright 9 * Redistributions of source code must retain the above copyright
10 notice, this list of conditions and the following disclaimer. 10 notice, this list of conditions and the following disclaimer.
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 </td></tr></table> 513 </td></tr></table>
514 514
515 515
516 </body> 516 </body>
517 517
518 <script> 518 <script>
519 519
520 keyIsDown = new Array(); 520 keyIsDown = new Array();
521 521
522 document.onkeydown = function(e) { 522 document.onkeydown = function(e) {
523 var keycode; 523 var keyChar = o3djs.event.getEventKeyChar(e);
524 if (window.event) { 524 keyIsDown[keyChar] = true;
525 keycode = window.event.keyCode;
526 } else if (e) {
527 keycode = e.which;
528 }
529 keyIsDown[keycode] = true;
530 } 525 }
531 526
532 document.onkeyup = function(e) { 527 document.onkeyup = function(e) {
533 var keycode; 528 var keyChar = o3djs.event.getEventKeyChar(e);
534 if (window.event) { 529 keyIsDown[keyChar] = false;
535 keycode = window.event.keyCode;
536 } else if (e) {
537 keycode = e.which;
538 }
539 keyIsDown[keycode] = false;
540
541 } 530 }
542 531
543 532
544 var x = 1000+10; 533 var x = 1000+10;
545 var y = 1000+20; 534 var y = 1000+20;
546 var z = 1; 535 var z = 1;
547 536
548 var BACKSPACE=8 537 var BACKSPACE=8
549 var TAB=9 538 var TAB=9
550 var ENTER=13 539 var ENTER=13
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 if (distanceY < 0) { 842 if (distanceY < 0) {
854 distanceY = distanceY * -1; 843 distanceY = distanceY * -1;
855 } 844 }
856 return distanceY; 845 return distanceY;
857 } 846 }
858 847
859 848
860 849
861 </script> 850 </script>
862 851
OLDNEW
« 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