| <html> |
| <head> |
| <script> |
| |
| function keyevent(event) { |
| var p = document.createElement("p"); |
| p.appendChild(document.createTextNode(event.type + " - key: " + event.keyIdentifier + "@" + event.keyLocation + " (keyCode/charCode: " + event.keyCode + "/" + event.charCode + ")" + " modifiers: " + event.ctrlKey + "," + event.altKey + "," + event.shiftKey + "," + event.metaKey)); |
| document.getElementById("result").appendChild(p); |
| } |
| |
| function init() { |
| var input = document.getElementById("testinput"); |
| input.addEventListener("keydown", keyevent, true); |
| input.addEventListener("keypress", keyevent, true); |
| input.addEventListener("keyup", keyevent, true); |
| |
| if (window.layoutTestController) |
| layoutTestController.dumpAsText(); |
| |
| input.focus(); |
| if (eventSender) { |
| eventSender.keyDown("\t"); |
| eventSender.keyDown("\t", new Array("shiftKey")); |
| } |
| } |
| </script> |
| </head> |
| <body onload="init()"> |
| <form> |
| <input type="text" size="50" id="testinput" /> |
| <input type="text" size="50" /> |
| </form> |
| |
| <p>This tests that DOMKeyboardEvents are created correctly in the JavaScript API.</p> |
| |
| <div id="result"></div> |
| </body> |
| </html> |