Subject: Re: [X2Go-Dev] Bug#674: Acknowledgement (keycode -> keycode translation harmful (makes configuration complex))

From: Ulrich Sibiller <[email-masked]>
Date: Mon, 8 Dec 2014 00:07:07 +0100

On Sun, Dec 7, 2014 at 5:07 AM, Robert Siemer <[email-masked]> wrote:
> On x2go session startup, the x2go Xserver [2] does a superficial
> investigation of what keyboard is used on the local Xserver [1] and sets up
> an incomplete keycode translation to a keyboard known as “xfree86”. It
> further creates an imperfect copy of the XKB configuration from [1] to [2].
> The _XKB_RULES_NAMES property on [2] is set to rules=xfree86, model = pc???,
> layout = us(?) [I forgot the details].
>
> Why is it a superficial investigation? – It takes the rules name from
> _XKB_RULES_NAMES and deducts the resulting keycodes directly from that (I
> believe). Even though in a common setup rules name “evdev” results in one
> specific set of keycodes and rules name “xfree86” in another specific set of
> keycodes, this is not a must.
>
> Why is the keycode translation incomplete? – As far as I observed it,
> “unusual” or unknown keycodes are not translated and passed as-is.
>
> Why is the XKB configuration copy imperfect? – I did a XKB dump on the local
> Xserver [1] and the x2go Xserver [2] after starting a new session. Keys with
> four levels of symbols turned into two-level-keysyms. – _Loading_ (i.e.
> xkbcomp/setxkbmap) a four-level configuration is no problem, though.
>
> Note: the imperfect copy of the XKB configuration is almost always useless,
> because the copied configuration does not match the new (translated)
> keycodes!
>
> Resuming an x2go session triggers the same superficial keyboard
> investigation, the translation kicks in again, but the XKB configuration is
> not touched (i.e. is not copied from [1] to [2]).
>
> Deleting the _XKB_RULES_NAMES property before session startup/resume or
> setting the first part (that is the “rules” part) to some unknown string
> results in untranslated keycodes.

I am not sure if I am getting this right. Will using xkbcomp on the
local server, pushing the result to the nxagent and loading it there
result in a clean keyboard setup or not? Do we need to disable setting
up the translation within the nx code to make that work?

Uli

BTW: You can find the code for the keycode translation in
nx-x11/programs/Xserver/hw/nxagent/Keyboard.c. It seems some kind of
translation from evdev to pc105 is done. You can also see that if
there is no "xfree86" rules file the one called "xorg" is used instead
(if available, of course).