Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / chrome / test / data / extensions / test_file_with_ctrl-d_keybinding.html
1 <head>
2   <script type="text/javascript">
3 var ctrlDown = false;
4 document.onkeyup = function(e) {
5   // Ctrl is 17, left Command is 91, right Command is 93
6   if (e.keyCode == 17 || e.keyCode == 91 || e.keyCode == 93)
7     ctrlDown = false;
8 }
9 document.onkeydown = function(e) {
10   // Ctrl is 17, left Command is 91, right Command is 93
11   if (e.keyCode == 17 || e.keyCode == 91 || e.keyCode == 93) {
12     ctrlDown = true;
13   } else if (String.fromCharCode(e.keyCode) == 'D' && ctrlDown) {
14     document.body.bgColor = "magenta";
15     return false;
16   }
17 };
18   </script>
19 </head>