After looking into this and trying to assemble information from several sources it starts to make sense. Here is what almost works for me.
- Setting right keyboard in X This is done with "setxkbmap <language code>" where language is a two letter code. In my case "setxkbmap no" works. A good guide to setxkbmap can be found at http://tldp.org/HOWTO/Intkeyb/x53.html
- Convert the X keyboard mapping to the Xrdp keymap format. This is done with the command "xrdp-genkeymap ~/km-0414.ini" The code 0414 is the code for Norway.,you have to replace this with yours. The complete list of country codes can be found at http://rdesktop.svn.sourceforge.net/...87&view=markup
- Enable the KM file. Log in as root and move the produced file with "mv ~/km-0409.ini /etc/xrdp/" and then set root as the owner of this file with "chown root:root /etc/xrdp/km-0409.ini"
- Stop the Xrdp server. First find the server processes with "ps -A | grep xrdp" and then "kill nnnn" where nnnn is the process id. Both the xrdp and the xrdp-sesman process should be killed.
- Restart the Xrdp process. This is done with the command "/etc/init.d/xrdp start" still as root.
HURRAY! Almost there
After this most of the keyboard is working except for the important AT sign (I can not write it), and some of the other AltGr symbols important for programming like braces and brackets.
The current X key map can be dumped with "xmodmap -pk > mykeys.txt
" and mykeys can be opened with a text editor. The columns are
- Key without any qualifier
- Shift + Key
- AltGr + Key
- Shift + AltGr + Key
The X key map symbols are given in hex while the Xrdp key map file uses the same symbols but converted to decimal values. Normally the same symbol is given before and after the comma, like for the A-key (number 38)
I have no idea what the colon means, and I have not understood why some keys have different values before and after the colon, but 97 = 0x61, which is just what we find in the X key map file "mykeys.txt".
The Xrdp keymap file has several sections that are obvious for the alternative alternation keys. For instance this say that for the number two key 11:
and 64 = 0x40 which is exactly the AT sign precisely where it should be on a Norwegian keyboard. However, it does not work! It seem that the altgr section is ignored for some reason, and AltGr+2 gives q
. So close but not yet....
Any ideas anyone?
Thanks a million!
---------- Post added 17th June 2011 at 07:55 AM ---------- Previous post was 16th June 2011 at 09:48 PM ----------
The missing AltGr characters can be defined with the xmodmap
command. The general syntax for my @ key at AltGr+2 was
xmodmap -e "keysym 2 = 2 quotedbl at quotedbl at"
Note that all five columns of the previously generated "mykeys.txt" are defined (with the equal sign between the first and the other four). As you can see [@] this works for all the missing AltGr combinations. The names of the symbols, like "quotedbl" for the double string quotes used around the keysym string, can best be found in the the previously generated "mykeys.text" file.
It is impractical to give the above xmodmap for the 8 AltGr+key combinations on the Norwegian keyboard missing. The solution is to create an "~/.Xmodmap" file containing only the command strings of the above commands. Mine looks like this:
keysym e = e E EuroSign e EuroSign
keysym 0 = 0 equal braceright equal braceright
keysym 2 = 2 quotedbl at quotedbl at
keysym 3 = 3 numbersign sterling numbersign sterling
keysym 4 = 4 currency dollar currency dollar
keysym 7 = 7 slash braceleft slash braceleft
keysym 8 = 8 parenleft bracketleft parenleft bracketleft
keysym 9 = 9 parenright bracketright parenright bracketright
This file is read every time KDE starts and combined the Xrdp keymap file and this defines all keys on my keyboard. A similar combo solution might also work for your language?