Wrong keyboard when remote desktopping from windows to linux

1

I installed xrdp on my Linux FC 17 KDE server, so that I can use mstsc from Windows to connect to it.

All works really well, except that I have a Swiss keyboard, and when I type say a Z, I get a Y on the screen (Swiss is QWERTZ and not QWERTY).

I installed Linux on the server while a Swiss keyboard was attached to it. Locally it works fine.

I tried adding a Swiss layout in the window called "Keyboard - KDE Control Module", but that doesn't help.

I use the same user, whether logging in locally or remotely.

How do I fix this problem?

Ant Kutschera

Posted 2013-01-16T20:57:03.047

Reputation: 121

Please log on to the server, open a terminal and post the output of this command: echo $LANG – terdon – 2013-01-16T21:05:51.817

en_US.UTF-8 - that's wrong! What do I do now? :-) – Ant Kutschera – 2013-01-16T21:09:45.783

@AntKutschera Buy a US keyboard? ;-) – weberc2 – 2013-01-16T21:11:10.633

Answers

0

Since you saw that the $LANG variable is wrong, you should try setting it in your ~/.bashrc.

Sorry, spoke too soon, and did not think. The $LANG variable controlls all aspects of your locale, not the keyboard layout as such. As far as I can tell, the easiest fix for this would be to add this line to your ~/.bashrc:

setxkbmap -layout de_CH

Now, I am not at all sure that is the correct name for the swiss layout you are using. I had a look around and this page suggests either de_CH or fr_CH. However, neither works on my system but that might be just because I don't have the relevant layouts. Play around with setxkbmap just open a terminal and try out some layouts:

setxkbmap -layout de_CH
setxkbmap -layout fr_CH

etc etc.

You can have a look at some locale names at /usr/share/i18n/locales/, maybe you can identify the one you need :).

terdon

Posted 2013-01-16T20:57:03.047

Reputation: 45 216

doesnt work :-( I set it, reboot, logged in remotely, checked the LANG variable which now reads de_CH.UTF-8 (Swiss German variant), but the keyboard is working the same as before :-( – Ant Kutschera – 2013-01-16T21:21:27.023

All it did was to make my shell output german error messages :-) – Ant Kutschera – 2013-01-16T21:27:35.687

Yeah, sorry, see my updated answer. – terdon – 2013-01-16T21:33:28.110

The setxkbmap doesnt work for me either. I am getting a bit further with this: http://forums.fedoraforum.org/showthread.php?t=265100 The first part (creating the file and putting it under /etc/xrdp and then rebooting works, but there are quite a few differences between my thinkpad T410 keyboard and that one. are there any graphical tools which I can use where I can click a key and see its code?

– Ant Kutschera – 2013-01-16T22:15:31.313

setxkbmap really should work... You just have to figure out the correct layout name. Have you tried a german german layout, as opposed to a swiss one? This command gives me a QWERTZ kezboard: setxkbmap -layout de – terdon – 2013-01-16T22:26:25.677

I worked out tonight that using VNC, the setxkbmap works as soon as I type it. But I am using xrdp and that works differently. I need to do what is described in the link I posted a couple of comments ago. But the problem is that only some of the keys start working better. Stuff like curly braces, which I need for programming, are input using the "alt" keys, and they don't work at all. Not even with vnc. – Ant Kutschera – 2013-01-17T21:55:23.087