[winswitch] Windows to Linux shadow: Wrong keyboard mapping

Frank Lömker floemker at gmx.de
Wed Mar 13 15:19:31 GMT 2019


Hello,

On 3/13/19 2:35 AM, Antoine Martin via shifter-users wrote:
> On 12/03/2019 22:39, Frank Loemker via shifter-users wrote:
>> Hello,
>>
>> I am currently trying to get shadow access from Windows 10 to Ubuntu Linux
>> 14.04 working. The server on the Linux box is using 1.0.13-r21370 64-bit.
>> The client on Windows is 1.0.13-r21474 32-bit. I tried as well 2.4.3-r21365
>> and 0.17.4-r12925 under Windows with exactly the same result.
>
> Please try 2.4.3 at both ends, or even 2.5rc3 from the beta channel.
> Keyboard mapping when shadowing is unlikely to work with older versions.
> (especially for the server version)

That unfortunately does not work. I am stuck on the server with Ubuntu 14.04,
and that has Python 3.4.3 and Python 2.7.6. Python3 is not supported on the
server and Python 2.7.6 is too old. Updating Python2 with something from a
PPA did not work as well as too many other packages depend on exactly the
correct Python 2.7.6 version.

>> All the time keyboard mapping is completely off. E.g.
>>     space  ->  'o'
>>     'p' -> '-'
>>     'y' -> ~
>>     Insert -> 'k'
>>     Home -> Return
>>     ...
>> From Linux to Linux it works fine, all keys are correct. It works as well fine when
>> using "start" to start a single program instead of using "shadow". For "start" all
>> keys are working when connecting from Windows to Linux.
>
> That's because the "start" mode will modify the keymap on the fly to
> match that of the client.
> In "shadow" mode, we try to translate all key events instead, leaving
> the server's existing keymap completely untouched.
> Finding the correct translation is not always easy, or even possible.

Thanks for the info. Looks a little bit as if no translation is done
here in this case, and thus keyval == keycode. Let's see if some hack
is possible.

Regards,

>> What I saw till now, from Windows to Linux:
>>     Client log: parse_key_event(<gtk.gdk.Event at 049D9560: GDK_KEY_PRESS keyval=space>, True)=<GTKKeyEvent object, contents: {'modifiers': [], 'group': 0, 'string': ' ', 'keyname': 'space', 'pressed': True, 'keyval': 32, 'keycode': 32}>
>>     Server log:  client parse_key_event(<gtk.gdk.Event at 049D9560: GDK_KEY_PRESS keyval=space>, True)=<GTKKeyEvent object, contents: {'modifiers': [], 'group': 0, 'string': ' ', 'keyname': 'space', 'pressed': True, 'keyval': 32, 'keycode': 32}>
>>
>> From Linux to Linux:
>>     Client log: client parse_key_event(<gtk.gdk.Event at 0x7f9200bf25a8: GDK_KEY_PRESS keyval=space>, True)=<GTKKeyEvent object, contents: {'modifiers': [], 'group': 0, 'string': ' ', 'keyname': 'space', 'pressed': True, 'keyval': 32, 'keycode': 65}>
>>     Server log: client parse_key_event(<gtk.gdk.Event at 0x7f9200bf25a8: GDK_KEY_PRESS keyval=space>, True)=<GTKKeyEvent object, contents: {'modifiers': [], 'group': 0, 'string': ' ', 'keyname': 'space', 'pressed': True, 'keyval': 32, 'keycode': 65}>
>>
>> I.e. if I interpret that correctly: The keycode in the Windows case is wrong. For
>> space a keycode of 32 is generated, which is exactly the 'o'. For the Linux case
>> the correct keycode 65 is generated. The windows case seems to send
>> keyval==keycode.
>>
>> I see that as well in the debug output of get_entries_for_keycode():
>>     Windows:
>>         get_entries_for_keycode(32)=((32, 32, 0, 0), (32, 32, 0, 1), (16777215, 32, 1, 0), (16777215, 32, 1, 1))
>>         get_entries_for_keycode(65)=((97, 65, 0, 0), (65, 65, 0, 1), (16777215, 65, 1, 0), (16777215, 65, 1, 1))
>>     Linux:
>>         get_entries_for_keycode(32)=((111, 32, 0, 0), (79, 32, 0, 1))
>>         get_entries_for_keycode(65)=((32, 65, 0, 0),)
>>
>> Keyboard:
>>     Windows: <xpra.platform.win32.keyboard.Keyboard object at 0x04F654B0>.get_layout_spec()=('us', ['us', 'us'], None, [])
>>
>> Am I doing something wrong? Or should I report a bug with complete logs attached?
>
> If you can reproduce the bug with the latest version (2.5rc3), then
> please file a ticket following the instructions found here:
> https://xpra.org/trac/wiki/Keyboard

-- 
Frank Lömker




More information about the shifter-users mailing list