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

  • Tutorial
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 kinds of Windows things.

Such a desktop configuration poses an annoying problem — on Windows, its languages ​​and their switching, on Linux — its own, so you constantly need to switch 3-4 times until you succeed. All the more so if the language is selected not on a window in Xorg, 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 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, it is necessary:

  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 I made my own using Microsoft Keyboard Layout Creator v1.4. 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 are to be determined from the digits, the rest are transmitted correctly).

To work, you need two files:

1. Download the installer layout, install it on Windows and leave only. 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 hooks 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 not able 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 .

Also popular now: