summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test/data/keyevent.html
blob: 36f0fbfb88a79a5362749746dfa0cd5f3d45f787 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<html>
  <head>
    <meta http-equiv="x-ua-compatible" content="chrome=1" />
    <title>ChromeFrame keyevent test</title>
    <script type="text/javascript"
        src="chrome_frame_tester_helpers.js"></script>

    <script type="text/javascript">
      var input_string = "";

      function OnKeyPress() {
        appendStatus("Key pressed: " +
                     String.fromCharCode(event.keyCode).toString());
        input_string += String.fromCharCode(event.keyCode).toString();

        if (input_string.length >= 6) {
          appendStatus("Sending message: " + input_string);
          window.externalHost.postMessage(input_string);
        }
      }
    </script>
  </head>

  <body onkeypress="OnKeyPress()">
    ChromeFrame full tab mode keyboard test. Verifies that keypress events make
    it correctly into ChromeFrame.
    <div id="statusPanel" style="border: 1px solid red; width: 100%">
      Keyboard test running....
    </div>
  </body>
</html>