[Thinlinc-technical] Keyboard configuration in KDE

Peter Åstrand astrand at cendio.se
Mon Jun 11 14:29:46 CEST 2012


Hi, see comments below:

>> Hi! In general, it is not necessary to change the keyboard layout in the
>> ThinLinc session. We are using the VNC protocol which is "layoutless"
>> and can in principle support all layouts at the same time. You need to
>> configure the correct keyboard layout on the client side though.
>
> This does work nicely in my KDE 4.8

Good.


>> * Some legacy applications does not adhere to the X11 protocol
>> specification, and tries to interpret the physical "keycode", in a
>> layout dependent way. This is why we have the -KeyboardMap compatibility
>> option, for simulating a physical keyboard. However, at this time, only
>> a few compatibility maps are defined: Swedish ("sv"), US English ("en"),
>> Brazilian ABNT2 ("pt-br") and Turkish ("tr").
>
> Ok. With the "strings" command applied to your Xvnc binary I saw that
> these four languages are hard coded into the binary. So this must be the
> reason why various attempts at using -KeyboardMap=de yielded no result
> whatsoever.

This is also documented near the /vsmagent/xserver_args parameter in our 
admin guide:

http://www.cendio.com/resources/docs/tag/configuration.html#configuration_vsmagent


>> * There's also something called XKB - X keyboard extension, which
>> provides a lot of new functionality, but at a great cost: It is a very
>> large and complex protocol. Bugs are common. At this time, we do not
>> provide XKB by default. It is possible to enable XKB in ThinLinc by
>> adding "+kb" to the /vsmagent/xserver_args parameter, although th/usr/lib/vmware/vnckeymap# ls
> de  de-ch  es  fi  fr  fr-be  fr-ch  is  it  jp  nl-be  no  pt  uk  us
> is is
>> not very well tested.
>
> This works in KDE for me, strangely only in my aged user account on the
> server but not in a newly created test account.

When changing /vsmagent/xserver_args, note that you need to restart 
"vsmagent", plus restart any running sessions. It could also be that you 
have files in your home directory, such as ~/.Xmodmap.



>> The VirtualBox ticket claims that they have XKB support, so you might
>> want to try this out and see if this helps.
>
> However, even in VBox running inside my KDE user account with XKB/+kb
> added to the Xvnc configuration AltGr never works, <CTL_L>+<Alt_L>
> brings about a German @ character but Shift over the numbers does not
> work properly and other AltGr chars neither.

I see, thanks for reporting this.


>> Wrt the KDE keyboard tools, it is possible that the settings are grayed
>> out due to missing XKB support.
>
> With the +kb option set they were visible but its use yielded variable
> success. BTW, would combining +kb and -KeyboardMap=nn make any sense if
> I used the right map in -KeyboardMap= ?

Perhaps for some applications, but I'd say that it's easier to leave it 
disabled.



> Interestingly, VMWare seems to have an option with which one can set the
> keyboard the VM receives.
>
> What puzzles me is that while VMWare player installs vnc keymaps under
>
> # ls /usr/lib/vmware/vnckeymap/*
> de  de-ch  es  fi  fr  fr-be  fr-ch  is  it  jp  nl-be  no  pt  uk  us
>
> # head /usr/lib/vmware/vnckeymap/us displays
> 0xff1b = 0x001 # Escape
...

VMware needs to translate from layoutless "keysyms" (such as 
0xff1b=XK_Escape) to machine-dependent "keycodes/scancodes" such as "0x1", 
which basically means "the first key in the first row".

Since ThinLinc is not a virtual machine but rather a terminal server 
environment, this is not necessary. Well, at least not with well behaved 
applications.



> # head /opt/thinlinc/share/rdesktop/keymaps/en-us
>
> # generated from XKB map us
> include common
> map 0x409

These files are for "rdesktop", the RDP client which is bundled in 
ThinLinc. It actually maps the other way: from "keysyms" to "scancodes", 
which RDP uses. These keymaps does not affect the ThinLinc session (Xvnc).



> Bottom line is for me that maybe with VMWare I could run Windows VMs
> with proper keyboard mappings in TL, but so far I see no way how I can
> use German keyboards in both KDE and VBox VMs, even if I forfeit
> switching languages in KDE, not using xkb.
>
> If some debugging of /opt/thinlinc/share/rdesktop/keymaps/de is needed
> for making -KeyboardMap=de in a TL Xvnc beta work, I'd gladly volunteer.

In principle, you should be able to achieve the same result as 
-KeyboardMap=de by configuring the layout after starting the session. This 
can be done by using tools such as "xmodmap". In the good old days, layout 
files were installed on the system, so you could run a command such as 
"xmodmap /usr/share/xmodmap/xmodmap.de" to switch to a german layout. 
However, this is no longer the case. You may be able to use the GUI tools 
and/or XKB instead. We have also created a bug for adding support for 
-KeyboardMap=de (bug id 4331).


Regards, 
---
Peter Åstrand		ThinLinc Chief Developer
Cendio AB		http://cendio.com
Teknikringen 8		http://twitter.com/ThinLinc
583 30 Linköping	http://facebook.com/ThinLinc
Phone: +46-13-214600	http://plus.google.com/112509906846170010689


More information about the Thinlinc-technical mailing list