1 |
Keyboard mapping |
2 |
================ |
3 |
This release of rdesktop uses a new, portable keyboard mapping |
4 |
implementation. It should hopefully work on all X11 systems. This new |
5 |
implementation only looks at X11 keysyms: Not on (nonportable) |
6 |
keycodes or modifier status. This means that rdesktop will obey your |
7 |
local keyboard configuration. For example, if you have swapped |
8 |
CapsLock and Control, rdesktop will use this mapping. |
9 |
|
10 |
XKB is currently not used. It seems like a good idea to me, but since |
11 |
some X servers (like Xvnc) does not support XKB, we still need to use |
12 |
the plain old interface as well, at least. |
13 |
|
14 |
There are still some small problems. |
15 |
|
16 |
* NumLock handling: NumLock is switched off when typing a non-numlock |
17 |
key. rdesktop does not know which keys are NumLock-dependent and |
18 |
not. When you type a numlock-dependent key again, NumLock is |
19 |
switched on on the server again. The only problem really is that the |
20 |
NumLock indicator in Wordpad etc switches on and off when you type. |
21 |
|
22 |
* CapsLock: CapsLock changes are never sent to the RDP server. This is |
23 |
a problem of the same type as NumLock: rdesktop does not know which |
24 |
keys that are modified by CapsLock and which are not. So, the |
25 |
CapsLock indicator in Wordpad etc will always be off. |
26 |
|
27 |
Composing/Multi_key is supported. For more information, see: |
28 |
|
29 |
MIT: $SRC/xc/nls/X11/locale/Compose/iso8859-1 |
30 |
XFree86: /usr/X11R6/lib/X11/locale/*/Compose |
31 |
Solaris' Openwin: /usr/openwin/include/X11/Suncompose.h |
32 |
/usr/openwin/lib/locale/*/Compose |
33 |
Irix6: compose(5) |
34 |
|
35 |
|
36 |
Keymap files |
37 |
============= |
38 |
The keymap-files have two-letter names. These follows ISO 639 |
39 |
(2-letter codes). ISO639 can be found at |
40 |
http://www.w3.org/WAI/ER/IG/ert/iso639.htm |
41 |
|
42 |
(You can find a translation from Windows keyboard layout numbers to |
43 |
keymap names by looking at |
44 |
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\MIME\Database\RFC1766 in the |
45 |
registry.) |
46 |
|
47 |
|
48 |
Contents of keymap files |
49 |
======================== |
50 |
The keymaps are line based. There are four different types of lines: |
51 |
|
52 |
1) include-lines |
53 |
Syntax: |
54 |
include <another-map-file> |
55 |
|
56 |
|
57 |
2) map-lines |
58 |
Syntax: |
59 |
map <hex-number> |
60 |
|
61 |
Map-lines specifies how the remote RDP server should interpret the |
62 |
sent scancodes. |
63 |
|
64 |
|
65 |
3) Translation-lines |
66 |
Syntax: |
67 |
<keysym-name> <scancode> [flags..] |
68 |
|
69 |
The scancode can be found in scancodes.h. Note: The scancode value for |
70 |
extended keys can be calculated by OR:ing with 0x80. Example: The |
71 |
Delete key have the scancode sequence 0xe0, 0x52. You can get the |
72 |
scancode value to put into the map file by running: |
73 |
|
74 |
python -c "print hex(0x80 | 0x52)" |
75 |
|
76 |
If flags are "altgr", "shift", "numlock", the scancode sent for this |
77 |
keysym will be prefix with AltGr, Shift or Numlock. |
78 |
|
79 |
If flags include "addupper", an translation for this keysyms uppercase |
80 |
name will as well, in addition to the non-uppercase name. Example: |
81 |
|
82 |
x 2d addupper |
83 |
|
84 |
...will add an translation for "X" automatically, just like if you |
85 |
would specify: |
86 |
|
87 |
X 2d shift |
88 |
|
89 |
If flags include "localstate", the modifier to send will be determined |
90 |
by the local modifier state. |
91 |
|
92 |
If flags is "inhibit", nothing will be sent to the server. |
93 |
|
94 |
|
95 |
4) enable_compose |
96 |
|
97 |
If any line starts with the keyword "enable_compose", rdesktop will |
98 |
enable local Compose/Multi_key handling. Enabling this will often make |
99 |
it impossible to compose characters with dead keys (on the remote |
100 |
side). This is because when local compose support is enabled, dead |
101 |
keys will not be sent to the remote side. |
102 |
|
103 |
|
104 |
Suggested X11 keysym mapping on PCs |
105 |
=================================== |
106 |
Unfortunately, there is no standard for which keysyms a given key |
107 |
should generate. If you have a PC-keyboard with Windows keys, I suggest this mapping: |
108 |
|
109 |
Keyboard keys: |
110 |
CtrlLeft WinLeft AltLeft Space AltGr WinRight Menu CtrlRight |
111 |
|
112 |
...should generate keysyms: |
113 |
Control_L Hyper_L Alt_L space Mode_switch Hyper_R Menu Control_R |
114 |
|
115 |
Additionally: |
116 |
Shift-Alt should produce Meta_L |
117 |
Shift-AltGr should produce Multi_Key. |
118 |
|
119 |
Use a modifier-map like this: |
120 |
|
121 |
shift Shift_L (0x32), Shift_R (0x3e) |
122 |
lock Caps_Lock (0x25) |
123 |
control Control_L (0x42), Control_R (0x6d) |
124 |
mod1 Alt_L (0x40) |
125 |
mod2 Num_Lock (0x4d) |
126 |
mod3 Mode_switch (0x71) |
127 |
mod4 Hyper_L (0x73), Hyper_R (0x74) |
128 |
mod5 Scroll_Lock (0x4e) |