blob: e5fcbd7853d5122831d1de2be584aab4bd07e231 [file] [log] [blame]
Pierre Ossmanefd42612014-09-17 13:55:51 +02001Test protocol for keyboard handling
2===================================
3
4Platform specific tests/issues are marked with [].
5
Pierre Ossmanb6116dd2016-06-10 15:03:13 +02006These tests are primarily about what is sent over the protocol and some
Pierre Ossman2ae77952018-10-19 16:22:12 +02007may be difficult or impossible to test using normal applications. One
8such case is that xev will see fake KeyRelease events on key repeat,
9even when no such events were sent by the client. In these cases you
10can turn on debug logging in either the client or the server by
11specifying "-Log *:stderr:100".
Pierre Ossmanb6116dd2016-06-10 15:03:13 +020012
13We currently have a limitation in Xvnc where it can run out of symbols,
14resulting in nothing being sent to the applications. Just run setxkbmap
15with any layout to reset the symbol table.
16
Pierre Ossman54338082017-09-18 16:22:41 +020017Client (classic, non-raw, mode)
18-------------------------------
Pierre Ossmanefd42612014-09-17 13:55:51 +020019
20- Normal symbols:
21
22 - ASCII characters
23 - Latin 1 character
24 - Unicode BMP characters
Pierre Ossman93454d92016-06-10 15:08:52 +020025 - Unicode non-BMP characters (does any layout actually have these?)
Pierre Ossmanefd42612014-09-17 13:55:51 +020026
27- Dead keys:
28
Pierre Ossmanb6116dd2016-06-10 15:03:13 +020029 These are not available on a single layout, so you need to switch to
30 test everything. The useful layouts also differ per platform:
31
32 X11: US International for most, Greek for some specific diacretics
33 Win: US International, Czech, Greek Polytonic, Vietnamese
Pierre Ossman93454d92016-06-10 15:08:52 +020034 OS X: ABC Extended (FIXME: lots of broken keys),
35 Greek (FIXME: cannot be used with TigerVNC)
Pierre Ossmanb6116dd2016-06-10 15:03:13 +020036
Pierre Ossmanefd42612014-09-17 13:55:51 +020037 - Grave
38 - Acute
39 - Circumflex
40 - Tilde
Pierre Ossman93454d92016-06-10 15:08:52 +020041 - Macron (FIXME: broken on Win)
Pierre Ossmanefd42612014-09-17 13:55:51 +020042 - Breve
43 - Dot above
Pierre Ossman30e34012016-06-10 15:06:21 +020044 - Dot below
Pierre Ossmanefd42612014-09-17 13:55:51 +020045 - Diaeresis
46 - Ring above
47 - Double acute
48 - Caron
49 - Cedilla
50 - Ogonek
Pierre Ossman93454d92016-06-10 15:08:52 +020051 - Ypogegrammeni (iota below) (FIXME: broken on Win)
52 - Dialytika tonos [Win] (Diaresis on X11, and maybe OS X?)
53 - Comma above (FIXME: broken on Win)
54 - Reversed comma above (FIXME: broken on Win)
55 - Horn [X11?]
56 - Hook above [Win?]
57 - Hook below [X11?, Win?]
58 - Dakuten (Katakana voiced mark) (Only Input Methods layouts?)
59 - Handakuten (Katakana semi-voiced mark) (Only Input Methods layouts?)
Pierre Ossmanefd42612014-09-17 13:55:51 +020060 - FIXME: Many more that we currently probably don't support
61
62 - No composition on client
63
64- Modifiers:
65
Pierre Ossmanb6116dd2016-06-10 15:03:13 +020066 X11: You can usually toggle Hyper/Super and Compose/Scroll_Lock using
67 XKB options.
68
Pierre Ossman671d05d2017-09-18 16:22:09 +020069 - CapsLock, NumLock
Pierre Ossmanefd42612014-09-17 13:55:51 +020070 - Shift, Ctrl
Pierre Ossman69428fe2018-03-08 17:24:54 +010071 - Alt, AltGr, Super [Win, X11]
72 - Ctrl+AltGr [Win]
Pierre Ossmanf1013e42016-06-10 15:04:33 +020073 - Meta [X11]
Pierre Ossman19e07542018-03-08 17:16:14 +010074 - Left/right identification (FIXME: broken release for Shift on Win)
Pierre Ossman93454d92016-06-10 15:08:52 +020075 - CmdL => AltL, CmdR => SuperL, AltL => ModeSwitch, AltR => Level3Shift [OS X]
Peter Åstrand (astrand)f3ff0f12015-10-14 13:47:28 +020076 - Hyper sends Super [X11]
Pierre Ossmanefd42612014-09-17 13:55:51 +020077
78 - CapsLock, Shift and AltGr affect symbol lookup
Pierre Ossmanefd42612014-09-17 13:55:51 +020079 - Ctrl does not affect symbol lookup
Pierre Ossman51249782018-03-08 14:05:39 +010080 - Ctrl+Alt+<ANY> sends the same symbol as <ANY>
Pierre Ossmanefd42612014-09-17 13:55:51 +020081 - "Shift press, A press, Shift release, A release" should not send "a release"
82
83- Numpad:
84
Pierre Ossman2ddee232016-06-10 15:03:59 +020085 - NumLock affects symbol lookup [Win, X11]
Pierre Ossmanefd42612014-09-17 13:55:51 +020086 - Numpad specific symbols are sent
Pierre Ossmanefd42612014-09-17 13:55:51 +020087 - Decimal key should send Decimal for layouts with . as a symbol, and
88 Separator for layouts with , as a symbol
Pierre Ossman2ddee232016-06-10 15:03:59 +020089 - Shift inverts NumLock behaviour [X11]
90 - Shift turns NumLock off, but not on [Win] (FIXME: fake Shifts also sent)
Pierre Ossmanefd42612014-09-17 13:55:51 +020091
92- Multimedia keys:
93
Pierre Ossman93454d92016-06-10 15:08:52 +020094 OS X: FIXME: all broken
95
Pierre Ossmanefd42612014-09-17 13:55:51 +020096 - Back, Forward, Refresh, Stop
Pierre Ossman93454d92016-06-10 15:08:52 +020097 - HomePage, Search, Favourites (FIXME: broken on Win)
Pierre Ossmanefd42612014-09-17 13:55:51 +020098 - Mail, Calculator
99 - Volume up, down, mute
100 - Media next, previous, stop, play
Pierre Ossman93454d92016-06-10 15:08:52 +0200101 - Sleep (FIXME: broken on Win)
Pierre Ossmanefd42612014-09-17 13:55:51 +0200102 - FIXME: probably more keys exist
103
104- Non-character keys:
105
Pierre Ossman93454d92016-06-10 15:08:52 +0200106 - F1-F24 (FIXME: F14-F15 broken on OS X)
Pierre Ossmanefb48a52016-06-10 15:08:24 +0200107 - Tab, Space, Backspace, Return, Esc
Pierre Ossman2ae77952018-10-19 16:22:12 +0200108 - LeftTab sends Tab [X11]
Pierre Ossmanefb48a52016-06-10 15:08:24 +0200109 - PrntScrn, ScrollLock, Pause [X11, Win]
110 - Help [X11?, OS X]
111 - Insert [X11, Win]
112 - Delete, Home, End, PageUp, PageDown
Pierre Ossmanefd42612014-09-17 13:55:51 +0200113 - Arrow keys
114 - Menu
Pierre Ossmana7d3dc72014-09-30 17:03:28 +0200115 - Alt+PrntScrn sends Sys_Req [Win]
Pierre Ossmanefd42612014-09-17 13:55:51 +0200116
117- French layout (AZERTY and inverted shift behaviour for many keys)
118
Pierre Ossman54338082017-09-18 16:22:41 +0200119- Local layout changes are respected
120
121Client (raw mode)
122-----------------
123
124- All physical keys (modifiers or type of symbol shouldn't matter)
125
126 - Normal keys
127 - Dead keys
128 - Numpad
129 - Multimedia keys
130 - Non-character keys
131
Pierre Ossman54338082017-09-18 16:22:41 +0200132Client (both modes)
133-------------------
134
Pierre Ossmanefd42612014-09-17 13:55:51 +0200135- Key repeat should not send repeated release events
136
137- Keys are released on loss of focus
138
Pierre Ossmanefd42612014-09-17 13:55:51 +0200139- Local input methods are disabled/enabled with focus
140
Pierre Ossman93454d92016-06-10 15:08:52 +0200141- System keys should be grabbed in full screen (FIXME: lots missing on Win)
Pierre Ossmanefd42612014-09-17 13:55:51 +0200142
143 The exact keys depends on the system and configuration, but it
144 is usually variants of these:
145
146 - Alt+Tab
147 - Super (and Super+other)
148 - Multimedia keys
149 - Ctrl+Alt+Delete
150 - Ctrl+Esc
151 - F8-F12
152
Pierre Ossman671d05d2017-09-18 16:22:09 +0200153- Lock key states:
154
155 - Adjusted on server when connecting
156 - Adjusted on server when regaining focus
157 - Server changes are honored when focused
158 - Server changes are not honored when not focused
159
160 - CapsLock
161 - NumLock (hidden state on macOS)
Pierre Ossman2ae77952018-10-19 16:22:12 +0200162 - ScollLock* [X11, Win]
163
164 * Usually needs to be enabled with: xmodmap -e "add mod3 = Scroll_Lock"
Pierre Ossman671d05d2017-09-18 16:22:09 +0200165
Pierre Ossmanefd42612014-09-17 13:55:51 +0200166- Virtual keyboard (as much of the above as is possible)
Pierre Ossman794812d2018-10-19 16:22:26 +0200167
168Server
169------
170
171- Fake key events
172
173 An extra press or release should be added before the real key press
174 in order to get the correct state to get the desired symbol. A second
175 fake event should be added after the real key press to restore state.
176 No extra events should be added for a key release.
177
178 Possible fake keys:
179
180 - Shift
181 - AltGr
182
183 - Shift+Tab bypasses this and never fake releases Shift
184
185- Alternative keys
186
187 A semantically equivalent key is sent when the desired key cannot be
188 reached in the current keyboard state:
189
190 - Left modifier <=> Right modifier (e.g. Alt_R for Alt_L)
191 - Keypad key <=> Standard key
192 - ISO_Level3_Shift <=> Mode_Switch
193
194- Meta for Shift+Alt (if server keymap agrees)
195
196- Lock key heuristics (for clients without lock key extension)
197
198 - CapsLock is corrected when A-Z or a-z are pressed
199 - CapsLock is corrected when Shift and A-Z or a-z are pressed*
200 - NumLock is corrected when 0-9 on the keypad are pressed
201
202 * Gives incorrect behaviour if the client doesn't have "Shift cancels
203 CapsLock behaviour", e.g. macOS