Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyboard uses incorrect keymap in russian layout #1576

Open
Mingun opened this issue May 8, 2020 · 1 comment
Open

Keyboard uses incorrect keymap in russian layout #1576

Mingun opened this issue May 8, 2020 · 1 comment

Comments

@Mingun
Copy link

Mingun commented May 8, 2020

My setup: I try to connect to my working machine with Ubuntu 18.04 from my laptop on Windows 10 with default windows RDP client mstsc.exe.

xrdp from Ubuntu repositories: version 0.9.5:

$ xrdp --version

xrdp: A Remote Desktop Protocol server.
Copyright (C) Jay Sorg 2004-2014
See http://www.xrdp.org for more information.
Version 0.9.5

I connect via vnc-any, which only one allows me to connect to my existing local session

My Ubuntu machine have 2 keyboard layouts: us and ru.
Laptop keyboard layout:
HP Pavilion Keyboard

When I connect via RDP, on russian layout I can't enter some symbols, instead corresponding symbol from US layout is printed. I have no such problem, when I use keyboard, directly connected to my Ubuntu machine. These symbols are:

I try to type I get
ж ;
б ,
ю .
. /
Ж :
Э "
Б /
, ?

I googled the problem, almost everywhere recommend run xrdp-genkeymap /etc/xrdp/km-00000419.ini. I tried this, but without a visible effect, although the file generated by the utility is different from the one delivered with the xrdp package (file extension renamed to .txt, because GitHub do not support files with .ini extension):

On another site, someone advised me to run xrdp-genkeymap after running the setxkbmap command, so I run

setxkbmap -layout 'ru,us'

Using file after that also has no effect.

For reference, I grabed all symbols, that produced by keyboard and summarize below (note, that physical layout of laptop keyboard and external keyboard slightly differs: key \| on external keyboard in the numbers row, before backspace, and on laptop in the qwerty row, last key in that row, see image above. That difference is reflected in the Native and RDP sections below):

  • Native
    • US
                   Default               ||      setxkbmap -layout 'ru,us'
      ----------------+------------------||------------------+------------------
          No-shift    |       Shift      ||      No-shift    |       Shift
      ----------------|------------------||------------------|------------------
      `1234567890-=\  |  ~!@#$%^&*()_+|  ||  `1234567890-=\  |  ~!@#$%^&*()_+|
      qwertyuiop[]    |  QWERTYUIOP{}    ||  qwertyuiop[]    |  QWERTYUIOP{}
      asdfghjkl;'     |  ASDFGHJKL:"     ||  asdfghjkl;'     |  ASDFGHJKL:"
      zxcvbnm,./      |  ZXCVBNM<>?      ||  zxcvbnm,./      |  ZXCVBNM<>?
      ----------------|------------------||------------------|------------------
      
    • RU
                   Default               ||      setxkbmap -layout 'ru,us'
      ----------------+------------------||------------------+------------------
          No-shift    |       Shift      ||      No-shift    |       Shift
      ----------------|------------------||------------------|------------------
      ё1234567890-=\  |  Ё!"№;%:?*()_+/  ||  ё1234567890-=\  |  Ё!"№;%:?*()_+/
      йцукенгшщзхъ    |  ЙЦУКЕНГШЩЗХЪ    ||  йцукенгшщзхъ    |  ЙЦУКЕНГШЩЗХЪ
      фывапролджэ     |  ФЫВАПРОЛДЖЭ     ||  фывапролджэ     |  ФЫВАПРОЛДЖЭ
      ячсмитьбю.      |  ЯЧСМИТЬБЮ,      ||  ячсмитьбю.      |  ЯЧСМИТЬБЮ,
      ----------------|------------------||------------------|------------------
      
  • RDP
    • US
                   Default               ||      setxkbmap -layout 'ru,us'
      ----------------+------------------||------------------+------------------
          No-shift    |       Shift      ||      No-shift    |       Shift
      ----------------|------------------||------------------|------------------
      `1234567890-=   |  ~!@#$%^&*()_+   ||  ё1234567890-=   |  Ё!"№;%:?*()_+
      qwertyuiop[]\   |  QWERTYUIOP{}|   ||  йцукенгшщзхъ\   |  ЙЦУКЕНГШЩЗХЪ|
      asdfghjkl;'     |  ASDFGHJKL:"     ||  фывапролд$э     |  ФЫВАПРОЛД^@
      zxcvbnm,./      |  ZXCVBNM<>?      ||  ячсмить?//      |  ЯЧСМИТЬ/Ю&
      ----------------|------------------||------------------|------------------
      
    • RU
                   Default               ||      setxkbmap -layout 'ru,us'
      ----------------+------------------||------------------+------------------
          No-shift    |       Shift      ||      No-shift    |       Shift
      ----------------|------------------||------------------|------------------
      ё1234567890-=   |  Ё!"№;%:?*()_+   ||  ё1234567890-=   |  Ё!"№;%:?*()_+
      йцукенгшщзхъ\   |  ЙЦУКЕНГШЩЗХЪ|   ||  йцукенгшщзхъ\   |  ЙЦУКЕНГШЩЗХЪ/
      фывапролд;э     |  ФЫВАПРОЛД:"     ||  фывапролджэ     |  ФЫВАПРОЛДЖЭ
      ячсмить,./      |  ЯЧСМИТЬ/Ю?      ||  ячсмитьбю.      |  ЯЧСМИТЬ/Ю,
      ----------------|------------------||------------------|------------------
      

Notice, that after setxkbmap -layout 'ru,us' russian layout without Shift works as expected, but with Shift instead of letter Б symbol / is entered.

Information about layouts (before setxkbmap):

$ setxkbmap -query -v 10
Setting verbose level to 10
locale is C
Trying to load rules file ./rules/evdev...
Trying to load rules file /usr/share/X11/xkb/rules/evdev...
Success.
Applied rules from evdev:
rules:      evdev
model:      pc105
layout:     us,ru,us
variant:    ,,
options:    grp:alt_shift_toggle,grp_led:scroll
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete
compat:     complete+ledscroll(group_lock)
symbols:    pc+us+ru:2+us:3+inet(evdev)+group(alt_shift_toggle)
geometry:   pc(pc105)
rules:      evdev
model:      pc105
layout:     us,ru,us
variant:    ,,
options:    grp:alt_shift_toggle,grp_led:scroll
$ setxkbmap -print -v 10
Setting verbose level to 10
locale is C
Trying to load rules file ./rules/evdev...
Trying to load rules file /usr/share/X11/xkb/rules/evdev...
Success.
Applied rules from evdev:
rules:      evdev
model:      pc105
layout:     us,ru,us
variant:    ,,
options:    grp:alt_shift_toggle,grp_led:scroll
Trying to build keymap using the following components:
keycodes:   evdev+aliases(qwerty)
types:      complete
compat:     complete+ledscroll(group_lock)
symbols:    pc+us+ru:2+us:3+inet(evdev)+group(alt_shift_toggle)
geometry:   pc(pc105)
xkb_keymap {
	xkb_keycodes  { include "evdev+aliases(qwerty)"	};
	xkb_types     { include "complete"	};
	xkb_compat    { include "complete+ledscroll(group_lock)"	};
	xkb_symbols   { include "pc+us+ru:2+us:3+inet(evdev)+group(alt_shift_toggle)"	};
	xkb_geometry  { include "pc(pc105)"	};
};
$ 

Please help fix this issue. If you need some additional info, maybe network capture, let me known, how to do that.

@Mingun
Copy link
Author

Mingun commented May 8, 2020

Just noticed, that if you run xev and try to press some keys with letters, than in us layout you see, that key press and key release events assumes different layouts: KeyPress event see wrong layout, but KeyRelease -- correct:
different-layouts-in-events.txt
In that file I

  • run xev
  • press the f key in us layout
  • close xev window

You also can see fake Num Lock press/release events, which is another bug #1578.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant