diff --git a/Home.md b/Home.md index 77e0d48..96dfa7b 100644 --- a/Home.md +++ b/Home.md @@ -14,6 +14,8 @@ noVNC is a browser based VNC client implemented using HTML5 technologies (Web So - [Performance Notes](wiki/Performance-notes) +- [Keyboard Events](wiki/KeyEvents) + ### Other noVNC pages: diff --git a/KeyEvents.md b/KeyEvents.md new file mode 100644 index 0000000..f1ff711 --- /dev/null +++ b/KeyEvents.md @@ -0,0 +1,182 @@ +Here are some notes about noVNC keyboard event handling. + +### Keyboard Events Across Browsers + +The following table is a list of keyboard events across different +browsers in the order that they happen for different keyboard +input/actions. This assumes that in keyDown, special keys have their +default action stopped and are prevented from bubbling (this stops the +keyPress event in Webkit and IE9). + +Similar information in more detail can be found at the [W3](http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/Note-KeyProps.html). + +Legend: + + D: = keyDown event + P: = keyPress event + U: = keyUp event + k/c/w = keyCode / charCode / which + u = undefined value + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Input
Action +
+ Webkit (Chrome/Safari) + + Firefox 4.0 (and 3.6) + + Opera 11 + + IE 9 +
+ 's' + + D: 83 / 0 / 83
+ P: 115 / 115 / 115
+ U: 83 / 0 / 83
+
+ D: 83 / 0 / 83
+ P: 0 / 115 / 115
+ U: 83 / 0 / 83
+
+ D: 83 / u / 83
+ P: 115 / u / 115
+ U: 83 / u / 83
+
+ D: 83 / u / u
+ P: 115 / u / u
+ U: 83 / u / u
+
+ F4 + + D: 115 / 0 / 115
+ P: ---------------
+ U: 115 / 0 / 115
+
+ D: 115 / 0 / 115
+ P: 115 / 0 / 0
+ U: 115 / 0 / 115
+
+ D: 115 / u / 115
+ P: 115 / u / 0
+ U: 115 / u / 115
+
+ D: 115 / u / u
+ P: ---------------
+ U: 115 / u / u
+
+ Ctrl-C + + D: 17 / 0 / 17
+ D: 67 / 0 / 67
+ P: ---------------
+ U: 67 / 0 / 67
+ U: 17 / 0 / 17
+
+ D: 17 / 0 / 17
+ D: 67 / 0 / 67
+ P: 0 / 99 / 99
+ U: 67 / 0 / 67
+ U: 17 / 0 / 17
+
+ D: 17 / u / 17
+ D: 67 / u / 67
+ P: 99 / u / 99
+ U: 67 / u / 67
+ U: 17 / u / 17
+
+ D: 17 / u / u
+ D: 67 / u / 67
+ P: ---------------
+ U: 67 / u / 67
+ U: 17 / u / 17
+
+ + +### Simple Keyboard Events Test + +Using the noVNC tests/input.html page, type the following key +combinations: + + 's' + F4 + Ctrl-C + '-' + Insert + +This should result in the following in the messages box (less the +blank lines). The values in parens can vary between browsers, but the +keysym values should be identical. + + 1: keyPress down keysym: 115 (key: 0, char: 115, which: 115) + 2: keyPress up keysym: 115 (key: 83, char: 0, which: 83) + + 3: keyPress down keysym: 65473 (key: 115, char: 0, which: 115) + 4: keyPress up keysym: 65473 (key: 115, char: 0, which: 115) + + 5: keyPress down keysym: 65507 (key: 17, char: 0, which: 17) + 6: keyPress down keysym: 99 (key: 67, char: 0, which: 67) + 7: keyPress up keysym: 99 (key: 67, char: 0, which: 67) + 8: keyPress up keysym: 65507 (key: 17, char: 0, which: 17) + + 9: keyPress down keysym: 45 (key: 0, char: 45, which: 45) + 10: keyPress up keysym: 45 (key: 109, char: 0, which: 109) + + 11: keyPress down keysym: 65379 (key: 45, char: 0, which: 45) + 12: keyPress up keysym: 65379 (key: 45, char: 0, which: 45) + + +In the same test page, type the following key combinations. There +should not be any default browser reponse to them. For example, Ctrl-W +should not close the tab and Alt-F should not activate a browser menu. + + Ctrl-W + Alt-F + +The resulting messages output should look like this: + + 13: keyPress down keysym: 65507 (key: 17, char: 0, which: 17) + 14: keyPress down keysym: 119 (key: 87, char: 0, which: 87) + 15: keyPress up keysym: 119 (key: 87, char: 0, which: 87) + 16: keyPress up keysym: 65507 (key: 17, char: 0, which: 17) + 17: keyPress down keysym: 65513 (key: 18, char: 0, which: 18) + 18: keyPress down keysym: 102 (key: 70, char: 0, which: 70) + 19: keyPress up keysym: 102 (key: 70, char: 0, which: 70) + 20: keyPress up keysym: 65513 (key: 18, char: 0, which: 18) + +All Ctrl key combinations should be properly suppressed across all +browsers and operating systems. In Opera, the Alt key combinations +cannot be properly suppressed. In Windows, all browsers seem to have +trouble properly suppressing Alt key combinations. Chrome is best with +a beep sound, other browsers open a Window. +a beep