Open gsabdiv opened 4 days ago
@gsabdiv - it's almost certainly the same issue as #2217. However, since I blundered my way through that one I've learned a lot more about how keyboard mappings work. I'm hopeful we can come up with a better solution for you.
I've got an old CentOS 8 VM I can use to look at this. I'm also lacking a Spanish keyboard, but I think I can work around that.
A couple of initial questions for you:-
1) I can't identify your keyboard on https://www.kbdlayout.info/. The Spanish keyboard listed appears to have a '{' for the Alt-GR on key you mention rather than the '['. Can you have a look at that site and tell me which keyboard you have?
2) What is the output of sudo grep keymap /var/log/xrdp.log
?
Thanks.
Sorry, I confused the keys. I don't have a Spanish one at my desk. You're right, { is in the row of the L key. (I think I got confused because xev did show [ and { being pressed) The xrdp.logs do have several lines of this: [INFO ] Loading keymap file /etc/xrdp/km-0000040a.ini [WARN ] local keymap file for 0x0000040a found and doesn't match built in keymap, using local keymap file They appeared before I created the new mapping.
I've had a look at this.
I've found an unrelated problem related to the Spanish keyboard, which is that the Left Alt key isn't being mapped correctly. We can come back to that.
The main problem we have is with the interface to TigerVNC, namely passing the AltGr key. You should be able to verify that on the login screen, this key is working as expected. The problem appears to be only when talking to the VNC server.
Historically, Windows VNC clients have not interfaced well with VNC servers. Microsoft decided to map the AltGr key to Ctrl + Alt. This has resulted in TigerVNC implementing all sorts of workarounds to cope with different clients sending different combinations which are supposed to represent AltGr:-
https://duckduckgo.com/?t=lm&q=tigervnc+altgr&atb=v320-1&ia=web
We seem to be falling foul of one of those workarounds. As far as I can tell, we're sending the correct KeySym 0xffea to TigerVNC, but it is being interpreted as ALT_L. I've tried disentangling this on the server side by changing the keymap, and hence changing the heuristic, but that's made quite a mess of the keyboard.
I'll raise a query with tigervnc and see if they can give me some ideas.
You can also try using the xorgxrdp
package and the Xorg
backend. That does not suffer from this problem.
I've just figured out a better fix for this - I've been getting confused between the right-hand ALT key (on some keyboards) and the AltGr key (on other keyboards).
@gsabdiv - Can you try installing this file as km-0000040a.ini?
It's got changes in for the two Alt keys.
xrdp version
0.10.1
Detailed xrdp version, build options
Operating system & version
Red Hat Enterprise Linux 8.10 (Ootpa)
Installation method
dnf / apt / zypper / pkg / etc
Which backend do you use?
tigervnc-1.13.1-12.el8_10.x86_64
What desktop environment do you use?
xterm
Environment xrdp running on
physical
What's your client?
mstsc.exe on Windows 10
Area(s) with issue?
Keyboard / Mouse
Steps to reproduce
✔️ Expected Behavior
get a [ (when running xev see a ISO_Level3_Shift for AltGr)
❌ Actual Behavior
get nothing (when running xev see a Alt_R+Shift_L for AltGr, which does give you the "[" in some applications, but not all)
When attaching a Spanish keyboard to the Linuxmachine and running setxkbmap es, xrdp-genkeymap generates this, which is completely different to the file included in the release tarball. For some reason, the development version doesn't contain the 40a mapping. keymapspanish.txt
Anything else?
I saw #2217, but I don't think it's related, no VMs involved.