3 <title>Event Test (Sending function-key events)
</title>
4 <script language=
"javascript" type=
"text/javascript">
6 var li
= document
.createElement("li");
7 li
.appendChild(document
.createTextNode(str
));
8 var console
= document
.getElementById("console");
9 console
.appendChild(li
);
11 function onKeyEvent(ev
) {
13 log('Type=' + ev
.type
+ ',' +
14 'keyCode=' + (ev
.which
|| ev
.keyCode
) + ',' +
15 'ctrlKey=' + ev
.ctrlKey
+ ',' +
16 'shiftKey=' + ev
.shiftKey
+ ',' +
17 'altKey=' + ev
.altKey
+ ',' +
18 'metaKey=' + ev
.metaKey
);
23 <p>This test verifies the keycodes sent when we press function keys.
</p>
24 <textarea id=
"test" rows=
"1" cols=
"40" onkeydown=
"return onKeyEvent(event);" onkeyup=
"return onKeyEvent(event);"></textarea>
25 <ul id=
"console"></ul>
26 <script language=
"javascript" type=
"text/javascript">
27 if (window
.testRunner
)
28 window
.testRunner
.dumpAsText();
29 var textarea
= document
.getElementById("test");
31 eventSender
.keyDown("F1");
32 eventSender
.keyDown("F2");
33 eventSender
.keyDown("F3");
34 eventSender
.keyDown("F4");
35 eventSender
.keyDown("F5");
36 eventSender
.keyDown("F6");
37 eventSender
.keyDown("F7");
38 eventSender
.keyDown("F8");
39 eventSender
.keyDown("F9");
40 eventSender
.keyDown("F10");
41 eventSender
.keyDown("F11");
42 eventSender
.keyDown("F12");