Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / ManualTests / log-keypress-events.html
blob87e2288406a3f60a29a5bb2bacac2f29fc1d3822
1 <html>
2 <body>
3 <p>This page is especially useful to test <a href="http://bugs.webkit.org/show_bug.cgi?id=5678">the shift-Tab issue</a>. Should see a code of 9.</p>
4 <form name="f">
5 Type here: <input id="field" type="text" />
6 </form>
7 <script language="javascript" type="text/javascript">
8 <!--
9 function logEvent(event) {
10 myDebugLog("--");
11 if (event.charCode)
12 myDebugLog("event.charCode: " + event.charCode);
13 if (event.which)
14 myDebugLog("event.which: " + event.which);
15 if (event.keyCode)
16 myDebugLog("event.keyCode: " + event.keyCode);
17 myDebugLog("shiftKey: " + event.shiftKey);
18 return false;
21 function myDebugLog(msg) {
22 var m = document.createElement("div");
23 m.appendChild(document.createTextNode(msg));
24 document.getElementById("debug-log").appendChild(m);
26 document.f.field.onkeypress = logEvent;
27 // -->
28 </script>
30 <div id="debug-log">
31 Key press values:
32 </div>
33 </body>
34 </html>