mirror of
https://github.com/novnc/noVNC.git
synced 2026-06-05 20:09:41 +00:00
Add KeyEvents page.
2
Home.md
2
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:
|
||||
|
||||
|
||||
182
KeyEvents.md
Normal file
182
KeyEvents.md
Normal file
@@ -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
|
||||
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
Input<br>Action
|
||||
</td>
|
||||
<td>
|
||||
Webkit (Chrome/Safari)
|
||||
</td>
|
||||
<td>
|
||||
Firefox 4.0 (and 3.6)
|
||||
</td>
|
||||
<td>
|
||||
Opera 11
|
||||
</td>
|
||||
<td>
|
||||
IE 9
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap>
|
||||
's'
|
||||
</td>
|
||||
<td nowrap>
|
||||
D: 83 / 0 / 83 <br>
|
||||
P: 115 / 115 / 115 <br>
|
||||
U: 83 / 0 / 83 <br>
|
||||
</td>
|
||||
<td nowrap>
|
||||
D: 83 / 0 / 83 <br>
|
||||
P: 0 / 115 / 115 <br>
|
||||
U: 83 / 0 / 83 <br>
|
||||
</td>
|
||||
<td nowrap>
|
||||
D: 83 / u / 83 <br>
|
||||
P: 115 / u / 115 <br>
|
||||
U: 83 / u / 83 <br>
|
||||
</td>
|
||||
<td nowrap>
|
||||
D: 83 / u / u <br>
|
||||
P: 115 / u / u <br>
|
||||
U: 83 / u / u <br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap>
|
||||
F4
|
||||
</td>
|
||||
<td nowrap>
|
||||
D: 115 / 0 / 115 <br>
|
||||
P: --------------- <br>
|
||||
U: 115 / 0 / 115 <br>
|
||||
</td>
|
||||
<td nowrap>
|
||||
D: 115 / 0 / 115 <br>
|
||||
P: 115 / 0 / 0 <br>
|
||||
U: 115 / 0 / 115 <br>
|
||||
</td>
|
||||
<td nowrap>
|
||||
D: 115 / u / 115 <br>
|
||||
P: 115 / u / 0 <br>
|
||||
U: 115 / u / 115 <br>
|
||||
</td>
|
||||
<td nowrap>
|
||||
D: 115 / u / u <br>
|
||||
P: --------------- <br>
|
||||
U: 115 / u / u <br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td nowrap>
|
||||
Ctrl-C
|
||||
</td>
|
||||
<td nowrap>
|
||||
D: 17 / 0 / 17 <br>
|
||||
D: 67 / 0 / 67 <br>
|
||||
P: --------------- <br>
|
||||
U: 67 / 0 / 67 <br>
|
||||
U: 17 / 0 / 17 <br>
|
||||
</td>
|
||||
<td nowrap>
|
||||
D: 17 / 0 / 17 <br>
|
||||
D: 67 / 0 / 67 <br>
|
||||
P: 0 / 99 / 99 <br>
|
||||
U: 67 / 0 / 67 <br>
|
||||
U: 17 / 0 / 17 <br>
|
||||
</td>
|
||||
<td nowrap>
|
||||
D: 17 / u / 17 <br>
|
||||
D: 67 / u / 67 <br>
|
||||
P: 99 / u / 99 <br>
|
||||
U: 67 / u / 67 <br>
|
||||
U: 17 / u / 17 <br>
|
||||
</td>
|
||||
<td nowrap>
|
||||
D: 17 / u / u <br>
|
||||
D: 67 / u / 67 <br>
|
||||
P: --------------- <br>
|
||||
U: 67 / u / 67 <br>
|
||||
U: 17 / u / 17 <br>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
### 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
|
||||
Reference in New Issue
Block a user