📜 ⬆️ ⬇️

Native Russian from Xorg to rdesktop is a trifle, but nice

All people have their own experience of using Linux desktop, but for me personally the linux desktop + rdesktop tandem into virtual machines is very important for me. The reasons for this are certain software, which often works only under Windows, or works better under Windows, as well as the need to test all sorts of Windows stuff.

Such a desktop configuration poses an annoying problem — on Windows, your languages ​​and their switching, on Linux — your own, so you constantly need to switch 3-4 times until you succeed. Especially, if the language is not selected in Xorg not pookonno, but globally.

I decided to investigate this problem and solve it somehow natively for all modes, so that Russian letters are typed in the rdesktop window exactly as they are typed in the Xorg windows. I will try to briefly describe the essence and technology of such a solution.

The essence of the problem lies in the fact that the RDP technology involves the transfer of scancodes, and not any specific characters. Accordingly, rdesktop has regular keymaps, which are automatically selected based on the current locale.
')
Therefore, you must:

  1. Create a special layout for Windows, which will simultaneously contain both English and Russian characters, selected by some modifier.
  2. Make a keymap that will transfer Russian letters as a scancode with a modifier. The regular keymap “ru” is made so that it sends Russian characters as AltGr + scancode. It lacks only the symbol "No.".

Such layouts exist (for example, Cyrilock), but I haven’t found one that works normally, so using Microsoft Keyboard Layout Creator v1.4 I made my own. MKLC collects dll layouts and makes it an installer. On the buttons in it, English characters are defined, Russian characters are defined as the AltGr + button (only 3 numbers need to be determined from the digits, the rest are transmitted correctly).

To work you need two files:

1. Download the layout installer, install it on Windows and leave it alone. If you connect not via rdesktop, but via the console - English will work, you can type Russian letters using Ctrl-Alt.

In Linux, you must put the keymap in the global (/ usr / share / rdesktop / keymaps) or user directory (~ / .rdesktop / keymaps).

A few nuances:

  1. An ISO_Next_Group 0x0 value has been added to the keymap so that pressing the language switch buttons is not transmitted to the other side and the above-mentioned No. sign.
  2. For reference - I have a switch through Caps Lock, the indicator and the window switch controller is engaged in gxkb.
  3. If you fix the layout and build it through MKLC - always call it differently and reboot the machine, it constantly catches the old versions of the layout library. It is best to uninstall it before rebooting.
  4. In Windows, the real position of the layouts does not always correspond to the keyboard settings, sometimes superfluous ones appear there. The correct status shows only the language switch panel.
  5. MKLC is often unable to correct the name of the layout, for this it must be downloaded from the installed ones in the system and re-save the source file.

References:
  1. Installer finished layouts .
  2. Keymap rdesktop .
  3. Source layout for MKLC v1.4 .

Source: https://habr.com/ru/post/421971/


All Articles