summaryrefslogtreecommitdiffstats
path: root/chrome/test/data/extensions/test_file_with_ctrl-d_keybinding.html
blob: 7848c98d621261aa9195a348b6550fa9d38e9e57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<head>
  <script type="text/javascript">
var ctrlDown = false;
document.onkeyup = function(e) {
  // Ctrl is 17, left Command is 91, right Command is 93
  if (e.keyCode == 17 || e.keyCode == 91 || e.keyCode == 93)
    ctrlDown = false;
}
document.onkeydown = function(e) {
  // Ctrl is 17, left Command is 91, right Command is 93
  if (e.keyCode == 17 || e.keyCode == 91 || e.keyCode == 93) {
    ctrlDown = true;
  } else if (String.fromCharCode(e.keyCode) == 'D' && ctrlDown) {
    window.domAutomationController.setAutomationId(0);
    window.domAutomationController.send('web page received');
    return false;
  }
};
  </script>
</head>