Closed stdedos closed 2 weeks ago
That's not easy unfortunately! This commit d49e84f3b9cafbc61b728c4e06d0583daf047482 (6 years ago) added a workaround for Gtk failing to convert the event key string into something we can use without throwing an exception. It remains in use to this day...
We could generate our own map, or perhaps change the server code to do the lookup based on Greek_UPSILON
alone, without using the string representation.
Either way, I'm not sure how to convert Greek_UPSILON
to a string automatically.
It might have to do something with how the keys end up on the server - and somehow its keyboard language is changed
Some Alt, Shift shortcuts don't pass cleanly, e.g. Alt+`
to cycle windows.
That usually leaves Alt
activated on the remote side, even if I have released the keys locally.
"Somehow then", it ends up triggering a layout change on the remote - causing the issue that local en/gr keys cannot be then "sent over" to the server.
But if it's that complex, let's leave it. I'd be nice if yet-again modifier keys would be passed on / reflected cleanly on the remote. However, "even that is broken" since, activating Alt+Shift as a language-changer, it blocks any Ctrl+Alt+Shift shortcut (and similarly, using Ctrl to "find mouse" also does "something else")
The key parsing issue is also recorded in https://github.com/Xpra-org/xpra/issues/4265#issuecomment-2198053577
Yeah, it is the same. Let's just ignore it, I guess 😕
Let's not.
We should be able to figure out the actual key from the keyname
, ie: Greek_UPSILON
.
We just need to find a mapping somewhere from the key name to a key string.
Or server-side, to a key sym or key code.
Idk. Isn't it possible to get which key was pressed - like coordinates? Then you just "press the key" which corresponds to those coordinates.
e.g.: Pressing Ö on the German keyboard
Reflects to ;
in US
Of course my suggestion is naive. You have to assume "same-kb layout" (ANSI/ISO), and if they keyboard "looks alike" (e.g., some kbs have some variant of /
key next to the LShift - what do you do with that key?)
... and of course that you can "decide" server's kb.
But I just wanted to write this out.
Idk. Isn't it possible to get which key was pressed - like coordinates?
The closest thing you will find is the keycode.
Unfortunately, that's already been cooked by whatever software layers sit between your keyboard controller and the OS then X11 (ie: evdev
).
Assuming that you run an X11 client, you can try the --keyboard-raw=yes
switch which will send and process all keyboard events untranslated. Assuming that the keyboard was detected correctly (and that's not easy at all) and mirrored correctly (also not easy) then this should give more or less the same result as local applications.
Caveats: some keys are intercepted by the OS / X11, modifier keys (..), sticky keys, remapped keys, etc.
Other platforms have completely different keycodes, so that's a non-starter.
Okay, so - impossible 😅 🙃
At least "my constant purpose" of being able to work on my Linux laptops via my desktop (without using kvms, docking stations etc etc).
Closing in favour of #4265 which has more details.
Describe the bug
To Reproduce Steps to reproduce the behavior:
System Information (please complete the following information):
Additional context Add any other context about the problem here. Please see "reporting bugs" in the wiki section.