| <html> |
| <head> |
| <title>Event Test (Sending function-key events)</title> |
| <script language="javascript" type="text/javascript"> |
| function log(str) { |
| var li = document.createElement("li"); |
| li.appendChild(document.createTextNode(str)); |
| var console = document.getElementById("console"); |
| console.appendChild(li); |
| } |
| function onKeyEvent(ev) { |
| ev = ev || event; |
| log('Type=' + ev.type + ',' + |
| 'keyCode=' + (ev.which || ev.keyCode) + ',' + |
| 'ctrlKey=' + ev.ctrlKey + ',' + |
| 'shiftKey=' + ev.shiftKey + ',' + |
| 'altKey=' + ev.altKey + ',' + |
| 'metaKey=' + ev.metaKey); |
| } |
| </script> |
| </head> |
| <body> |
| <p>This test verifies the keycodes sent when we press function keys.</p> |
| <textarea id="test" rows="1" cols="40" onkeydown="return onKeyEvent(event);" onkeyup="return onKeyEvent(event);"></textarea> |
| <ul id="console"></ul> |
| <script language="javascript" type="text/javascript"> |
| if (window.testRunner) |
| window.testRunner.dumpAsText(); |
| var textarea = document.getElementById("test"); |
| textarea.focus(); |
| eventSender.keyDown("F1"); |
| eventSender.keyDown("F2"); |
| eventSender.keyDown("F3"); |
| eventSender.keyDown("F4"); |
| eventSender.keyDown("F5"); |
| eventSender.keyDown("F6"); |
| eventSender.keyDown("F7"); |
| eventSender.keyDown("F8"); |
| eventSender.keyDown("F9"); |
| eventSender.keyDown("F10"); |
| eventSender.keyDown("F11"); |
| eventSender.keyDown("F12"); |
| </script> |
| </body> |
| </html> |