Xpra: Ticket #1484: HTML5 client. Keyboard layout on-fly change

Follow up from #1487: Hello, Somebody already told about this function but seems not declared ticket (at least I have not found, correct me if I am wrong). So it would perfect if that function appears in the following versions.

Mon, 03 Apr 2017 18:28:42 GMT - Denis01:

Version html5-2.0.1-2.r15507

system reacts on keyboard change (in tray or by hot-keys) but after the switch EN->RU cyrrilic symbols are not treated properly - nothing appears and remote application considers the symbols typied as key-combinations cnrt-F, cntr-C, etc To restore it is needed to re-login with preferred language to use and not to change keyboard on-fly to avoid the problem appear

Mon, 03 Apr 2017 18:30:01 GMT - Denis01: type changed

Tue, 04 Apr 2017 08:14:13 GMT - Antoine Martin: owner, description changed

"en" keys (latin keys really) are still mapped on a "ru" keyboard layout, which is why switching from "ru" to "en" works. But many "ru" keys do not exist on an "en" keyboard layout, and so they cannot be mapped.

Sadly, there is no reliable way of detecting the current locale used for keyboard input. See "locale" in KeyboardEvent (only supported by IE) And even the more convoluted layout detection code we have does not apply when the user changes the layout: if I call setxkbmap us on my client system, all the HTTP request headers and all the browser attributes still have my preferred locale first ("en_GB"). r15510 adds code to re-detect the keyboard layout whenever one of those properties changes, but it doesn't fire with chrome or Firefox. (not tested IE)

So I was starting to think that this could not be fixed without requiring user interaction and adding a language menu to the html5 toolbar. (planned in #1471) But then it occurred to me that we can guess which keyboard layout is actually needed based on the keyname (ie: "Thai_thothan" requires a "Thai" or "th" keyboard layout), so r15511 does that. With this change, the HTML5 client will request the server to switch to a new keyboard layout when it sees keys it knows belongs to a specific layout ("Greek", "Thai", "Cyrillic", "Hebrew", etc)


Wed, 05 Apr 2017 11:55:13 GMT - Denis01: status changed; resolution set

Hello, had some fun with VPS provider on OS version :-) Now ready for tests

version 2.1-r15507 64-bit Linux CentOS Linux 7.3.1611 Chrome

it seems that everything works properly. En->Ru, Ru->En Fantastic! Closed

Sun, 09 Jun 2019 11:14:57 GMT - Antoine Martin:

See also #2154

Sat, 23 Jan 2021 05:25:33 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/1484