/[rdesktop]/sourceforge.net/trunk/rdesktop/doc/keymapping.txt
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/doc/keymapping.txt

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 167 by astrand, Mon Sep 16 18:54:50 2002 UTC revision 1419 by astrand, Mon Oct 8 12:34:05 2007 UTC
# Line 13  the plain old interface as well, at leas Line 13  the plain old interface as well, at leas
13    
14  There are still some small problems.  There are still some small problems.
15    
16  * NumLock handling: NumLock is switched off when typing a non-numlock  * CapsLock: CapsLock changes are never sent to the RDP
17    key. rdesktop does not know which keys are NumLock-dependent and    server. rdesktop does not know which keys that are modified by
18    not. When you type a numlock-dependent key again, NumLock is    CapsLock and which are not. So, the CapsLock indicator in Wordpad
19    switched on on the server again. The only problem really is that the    etc will always be off.
   NumLock indicator in Wordpad etc switches on and off when you type.  
   
 * CapsLock: CapsLock changes are never sent to the RDP server. This is  
   a problem of the same type as NumLock: rdesktop does not know which  
   keys that are modified by CapsLock and which are not. So, the  
   CapsLock indicator in Wordpad etc will always be off.  
20    
21  Composing/Multi_key is supported. For more information, see:  Composing/Multi_key is supported. For more information, see:
22    
# Line 34  Composing/Multi_key is supported. For mo Line 28  Composing/Multi_key is supported. For mo
28    
29    
30  Keymap files  Keymap files
31  =============  ============
32  The keymap-files have two-letter names. These follows ISO 639  The names of the keymaps follows RFC1766.
 (2-letter codes). ISO639 can be found at  
 http://www.w3.org/WAI/ER/IG/ert/iso639.htm  
33    
34  (You can find a translation from Windows keyboard layout numbers to  (You can find a translation from Windows keyboard layout numbers to
35  keymap names by looking at  keymap names by looking at
# Line 49  Contents of keymap files Line 41  Contents of keymap files
41  ========================  ========================
42  The keymaps are line based. There are four different types of lines:  The keymaps are line based. There are four different types of lines:
43    
44  1) include-lines  1) include lines
45  Syntax:  Syntax:
46  include <another-map-file>  include <another-map-file>
47    
48    Example:
49    include common
50    
51  2) map-lines  
52    2) map lines
53  Syntax:  Syntax:
54  map <hex-number>  map <hex-number>
55    
56    Example:
57    map 0x41d
58    
59  Map-lines specifies how the remote RDP server should interpret the  Map-lines specifies how the remote RDP server should interpret the
60  sent scancodes.  sent scancodes.
61    
62    
63  3) Translation-lines  3) Translation lines
64  Syntax:  Syntax:
65  <keysym-name> <scancode> [flags..]  <keysym-name> <scancode> [flags..]
66    
67    Example:
68    onehalf 0x29 shift
69    
70  The scancode can be found in scancodes.h. Note: The scancode value for  The scancode can be found in scancodes.h. Note: The scancode value for
71  extended keys can be calculated by OR:ing with 0x80. Example: The  extended keys can be calculated by OR:ing with 0x80. Example: The
72  Delete key have the scancode sequence 0xe0, 0x52. You can get the  Delete key have the scancode sequence 0xe0, 0x52. You can get the
# Line 73  scancode value to put into the map file Line 74  scancode value to put into the map file
74    
75  python -c "print hex(0x80 | 0x52)"  python -c "print hex(0x80 | 0x52)"
76    
77  If flags are "altgr", "shift", "numlock", the scancode sent for this  If flags are "altgr", "shift", the scancode sent for this keysym will
78  keysym will be prefix with AltGr, Shift or Numlock.  be prefixed with AltGr, or Shift.
79    
80  If flags include "addupper", an translation for this keysyms uppercase  If flags includes "addupper", a translation for this keysyms uppercase
81  name will as well, in addition to the non-uppercase name. Example:  name will be added as well, in addition to the non-uppercase
82    name. Example:
83    
84  x 2d addupper  x 2d addupper
85    
# Line 91  by the local modifier state. Line 93  by the local modifier state.
93    
94  If flags is "inhibit", nothing will be sent to the server.  If flags is "inhibit", nothing will be sent to the server.
95    
96    If flags is "numlock", rdesktop will make sure that the remote NumLock
97    state is on before generating the key event. Otherwise, it will make
98    sure NumLock is off.
99    
100    
101  4) enable_compose  4) enable_compose
102    
# Line 101  side). This is because when local compos Line 107  side). This is because when local compos
107  keys will not be sent to the remote side.  keys will not be sent to the remote side.
108    
109    
110    5) sequence lines
111    Syntax:
112    sequence <event-keysym-name> <keysym-name1> <keysym-name2> ...
113    
114    Examples:
115    sequence eacute dead_acute e
116    sequence F12 f o o at e x a m p l e period c o m
117    
118    Sequence lines allows you to specify that multiple scancodes should be
119    sent to the RDP server, in response to one X11 keyboard event. Note:
120    The sequence is sent at the X11 KeyPress event. Nothing is sent at
121    KeyRelease.
122    
123    
124    6) keyboard_type lines
125    Syntax:
126    keyboard_type <hex-number>
127    
128    keyboard_type lines specifies the keyboard type. Default value is 0x4
129    (en-us 101/104 keys keyboard).
130    
131    
132    7) keyboard_subtype lines
133    Syntax:
134    keyboard_subtype <hex-number>
135    
136    keyboard_subtype lines specifies the keyboard subtype. Default value
137    is 0x0 (en-us 101/104 keys keyboard).
138    
139    
140    8) keyboard_functionkeys lines
141    Syntax:
142    keyboard_functionkeys <hex-number>
143    
144    keyboard_functionkeys specifies the number of keyboard function
145    keys. Default value is 0xc (12, for standard 101/104 keys keyboard).
146    
147    
148    
149    
150  Suggested X11 keysym mapping on PCs  Suggested X11 keysym mapping on PCs
151  ===================================  ===================================
152  Unfortunately, there is no standard for which keysyms a given key  Unfortunately, there is no standard for which keysyms a given key
# Line 110  Keyboard keys: Line 156  Keyboard keys:
156  CtrlLeft WinLeft AltLeft Space AltGr WinRight Menu CtrlRight  CtrlLeft WinLeft AltLeft Space AltGr WinRight Menu CtrlRight
157    
158  ...should generate keysyms:  ...should generate keysyms:
159  Control_L Hyper_L Alt_L space Mode_switch Hyper_R Menu Control_R  Control_L Super_L Alt_L space Mode_switch Super_R Menu Control_R
160    
161  Additionally:  Additionally:
162  Shift-Alt should produce Meta_L  Shift-Alt should produce Meta_L
# Line 124  control     Control_L (0x42),  Control_R Line 170  control     Control_L (0x42),  Control_R
170  mod1        Alt_L (0x40)  mod1        Alt_L (0x40)
171  mod2        Num_Lock (0x4d)  mod2        Num_Lock (0x4d)
172  mod3        Mode_switch (0x71)  mod3        Mode_switch (0x71)
173  mod4        Hyper_L (0x73),  Hyper_R (0x74)  mod4        Super_L (0x73),  Super_R (0x74)
174  mod5        Scroll_Lock (0x4e)  mod5        Scroll_Lock (0x4e)
175    
176    
177    Updating / writing keymap files
178    ===============================
179    When writing new or updating keymap files, please use comments and
180    blanks, to increase readability. The "sv" keymap is a good template.
181    
182    When you need to add a translation to a keymap file, do:
183    
184        1. Get the "key number" for this key, by looking at keynums.png.
185    
186        2. Take a look at scancodes.h, and look for
187        SCANCODE_KEY_<my-key-number>. The scancode value is at the end of
188        the line. If the line contains (SCANCODE_EXTENDED | 0xsomething),
189        then you should OR 0x80 to this value. For example, you can do:
190        
191        python -c "print hex(0x80 | 0xsomething)"
192    
193        3. Put the scancode (from step 2) and keysym name (found in the
194        error message) into the keymap file.
195    
196    
197    Special keys
198    ============
199    
200    * The combination Ctrl-Alt-Enter toggles between fullscreen and
201      non-fullscreen mode.
202    
203    * Meta, Hyper and Super are treated as windows keys. RDP4 does not
204      support the windows keys though, so if you are running RDP4, these
205      keys will translate to Ctrl-Esc.
206    
207    
208    Links
209    =====
210    http://www.win.tue.nl/~aeb/linux/kbd/scancodes.html
211    
212    
213    Test cases
214    ==========
215    When changing the keyboard code, make sure all these tests in Notepad
216    works:
217    
218    1. Ctrl+f should bring up Find dialog, with CapsLock both on and off.
219    
220    2. Ctrl+Shift+arrows should mark text, with CapsLock both on and off.
221    
222    3. Test a sequence, like egrave.
223    
224    4. Test a char generated with AltGr, such as @ on a swedish keyboard.
225    
226    5. Test Ctrl-Alt-Delete.
227    
228    6. Ctrl-Alt-Enter should toggle fullscreen.
229    
230    7. Test NumLock synchronization using the -N option. Excel is able to
231       indicate the current NumLock state. Verify that the status is
232       updated correctly on reconnects.
233    
234    8. Test the Windows keys, standalone as well as in combination with,
235       say, E.
236    
237    9. Make sure the system menu (via Alt-space) cannot be accessed in
238       single app mode.
239    
240    10. Make sure keymaps can be loaded from ~/.rdesktop/keymaps,
241        KEYMAP_PATH, $CWD/keymaps, and from an absolute path.
242    
243    11. Press Shift, then press a key modified by shift, the release
244        shift, then release the other key.  Do this in a speedy fasion.
245        Make sure the shift state is not stuck down.
246    
247    12. Test all numpad keys, when not using the -N option.
248    
249    13. Map a single, un-shifted key (such as F1) to XK_A:
250        xmodmap -e "keycode 67 = A A"
251    
252        Perform in Notepad:
253        * Write some text
254        * Press F1
255        * Press b
256        * Release b
257        * Release F1
258    
259        Verify that shift is not stuck down, by clicking on the text.

Legend:
Removed from v.167  
changed lines
  Added in v.1419

  ViewVC Help
Powered by ViewVC 1.1.26