Author Topic: FreeRDP keyboard settings / host does not honor German keyboard layout  (Read 11007 times)

Andi B.

  • Hero Member
  • *****
  • Posts: 887
  • Karma: +15/-2
    • View Profile
I've tried FreeRDP to connect to different Linux boxes. It works but using FreeRDP the Linux host uses EN keyboard layout. All my Linux boxes does have German keyboards attached and work as expected when I'm sitting in front of them. My OS/2 system has a German keyboard too. But when I connect from my OS/2 system a Linux host via FreeRDP they get the English keys instead the German ones.

I don't see any setting in our FreeRDP port to translate the keys. Is there anything I'v to adjust on Linux (host) side?

Andi B.

  • Hero Member
  • *****
  • Posts: 887
  • Karma: +15/-2
    • View Profile
Re: FreeRDP keyboard settings / host does not honor German keyboard layout
« Reply #1 on: December 08, 2023, 06:26:07 pm »
Answering myself, I've to set for the rdp user in hardware setting the keyboard layout. Only problem now is "<Alt Gr>" and "<Alt> <Strg>" do not work as expected. F.i. I can't input a ~ or € on the remote system.

Andi B.

  • Hero Member
  • *****
  • Posts: 887
  • Karma: +15/-2
    • View Profile
Re: FreeRDP keyboard settings / host does not honor German keyboard layout
« Reply #2 on: February 03, 2024, 11:31:27 am »
Now I've still the problem that I've to switch manually from 'en' to 'de' every time I connect to this linux box. This drives me crazy.

Directly connected to the Linux box all works well. I log in and have my default German keyboard layout. But connect in parallel via FreeRDP to the same system it always switch to 'en'. Have to click in the bar (similar what xcenter is) to switch back to 'de'. There must be something FreeRDP related which let Linux think it should use English keyboard instead. Some LANG setting or?

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1401
  • Karma: +27/-0
    • View Profile
Re: FreeRDP keyboard settings / host does not honor German keyboard layout
« Reply #3 on: February 03, 2024, 03:03:04 pm »
Hey Andi,

I've tried FreeRDP to connect to different Linux boxes. It works but using FreeRDP the Linux host uses EN keyboard layout. All my Linux boxes does have German keyboards attached and work as expected when I'm sitting in front of them. My OS/2 system has a German keyboard too. But when I connect from my OS/2 system a Linux host via FreeRDP they get the English keys instead the German ones...

So I picked this up from an on-line FreeRDP User Manual (https://sysadminmosaic.ru/_media/freerdp/freerdp-user-manual.pdf), and while it's specficially calling out the use of xfreerdp, perhaps it works on our port as well:

Code: [Select]
xfreerdp .../kbd:0x409

where "/kbd:0x409" is they remote session keyboard layout you want to use, and in the case of non-EN setups you can use one of these:

Code: [Select]
Keyboard Layouts
0x00000401 Arabic (101)
0x00000402 Bulgarian
0x00000404 Chinese (Traditional) - US Keyboard
0x00000405 Czech
0x00000406 Danish
0x00000407 German
0x00000408 Greek
0x00000409 US

Looking at our port, I see the following option showing up:

Code: [Select]
/kbd:[layout:[0x<id>|<name>],lang:<0x<id>>,fn-key:<value>,type:<value>
      subtype:<value>,unicode[:on|off],remap:<key1>=<value1>
      remap:<key2>=<value2>,pipe:<filename>]
                                  Keyboard related options:* layout: set the
                                  keybouard layout announced to the server*
                                  lang: set the keyboard language identifier
                                  sent to the server* fn-key: Function key
                                  value* pipe: Name of a named pipe that can
                                  be used to type text into the RDP session

So it would at least appear like you should be able to set this. Give it a try and see if that helps?

Andi B.

  • Hero Member
  • *****
  • Posts: 887
  • Karma: +15/-2
    • View Profile
Re: FreeRDP keyboard settings / host does not honor German keyboard layout
« Reply #4 on: February 03, 2024, 04:17:13 pm »
Our FreeRDP comes with nice objects to setup a connection. Unfortunately I didn't find how to add additional parameters there. So I played with command line. But no matter what I try I can't get the /kdb: option to work. F.e.
Code: [Select]
ofreerdp.exe /u:xxxx /p:xxxx /w:2100 /h:1800 /v:m92p works but
Code: [Select]
ofreerdp.exe /u:xxxx /p:xxxx /w:2100 /h:1800 /kdb:de /v:m92p or any other value I tried for /kdb including /kbd:0x409 does not. :-(

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1401
  • Karma: +27/-0
    • View Profile
Re: FreeRDP keyboard settings / host does not honor German keyboard layout
« Reply #5 on: February 03, 2024, 04:37:46 pm »
...
Code: [Select]
ofreerdp.exe /u:xxxx /p:xxxx /w:2100 /h:1800 /kdb:de /v:m92p or any other value I tried for /kdb including /kbd:0x409 does not. :-(

Could it be that you need to spec out the "lang" part of this as well?:

Code: [Select]
ofreerdp.exe /u:xxxx /p:xxxx /w:2100 /h:1800 /kdb:0x407,lang:0x407 /v:m92p


This should set both the keyboard layout AND language to be used. I'm assuming here both IDs are the same value for German setup.

Andi B.

  • Hero Member
  • *****
  • Posts: 887
  • Karma: +15/-2
    • View Profile
Re: FreeRDP keyboard settings / host does not honor German keyboard layout
« Reply #6 on: February 03, 2024, 04:47:21 pm »
Unfortunately not. But I've found a bug report that says /kbd: together with some size options don't work. Maybe that's fixed now. But would be cool if I could find some working example.

Dariusz Piatkowski

  • Hero Member
  • *****
  • Posts: 1401
  • Karma: +27/-0
    • View Profile
Re: FreeRDP keyboard settings / host does not honor German keyboard layout
« Reply #7 on: February 03, 2024, 08:58:35 pm »
...not sure what else to try, but msg Andrey, I've worked with him on a few issues in the past and he's really good & attentive...so I'm guessing he'll give this things a try!

EDIT
====
No answers, but perhaps some more info to simplify the troubleshooting:

1) MS Info on Default Input Locales => https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-vista/cc766503%28v=ws.10%29?redirectedfrom=MSDN

2) FreeRDP issue tracker - 'Option to use the local keyboard layout' => https://github.com/FreeRDP/FreeRDP/issues/3121

- this is NOT quite what you are trying to do, but some of the comments reference the type of functionality that I think you are aiming to have
« Last Edit: February 03, 2024, 11:55:27 pm by Dariusz Piatkowski »

Digi

  • Jr. Member
  • **
  • Posts: 79
  • Karma: +4/-1
  • http://os2.snc.ru/
    • View Profile
    • OS/2 ports and applications
Re: FreeRDP keyboard settings / host does not honor German keyboard layout
« Reply #8 on: February 06, 2024, 12:31:01 am »
But when I connect from my OS/2 system a Linux host via FreeRDP they get the English keys instead the German ones.

Please try playing with the /kbd: switch in the latest version ( see http://os2.snc.ru/product-freerdp.html ). Something like this: /kbd:layout:0x00000407,lang:0x0407
All previous OS/2 ports were missing some function calls associated with this switch to configure the keyboard.

Note that lists of keyboards and languages can be obtained with the /list: switch.

Andi B.

  • Hero Member
  • *****
  • Posts: 887
  • Karma: +15/-2
    • View Profile
Re: FreeRDP keyboard settings / host does not honor German keyboard layout
« Reply #9 on: December 28, 2024, 11:09:25 am »
This seems to work with the current version 20241210. At least with my very limited testing until now. Sorry couldn't test before. But now I've to setup a new Debian box which I need rdp and with your suggested settings keyboard works better now.

Still not working is <Alt Gr> <e> EURO character and even worse @ (Alt Gr + q). Or better said I've not found a way to insert these. The way with <Alt> + number keys don't work too. No clue if this is a general limitation of rdp or some setting or....

Digi

  • Jr. Member
  • **
  • Posts: 79
  • Karma: +4/-1
  • http://os2.snc.ru/
    • View Profile
    • OS/2 ports and applications
Re: FreeRDP keyboard settings / host does not honor German keyboard layout
« Reply #10 on: February 14, 2025, 07:00:26 am »
Hi

Still not working is <Alt Gr> <e> EURO character and even worse @ (Alt Gr + q). Or better said I've not found a way to insert these. The way with <Alt> + number keys don't work too. No clue if this is a general limitation of rdp or some setting or....

I see my old comment in the source code:

  /* Support for the AltGr key on a German keyboard
     (Request from Herwig Bauernfeind). */

Then the following scheme is executed: 1. The current country for OS/2 is recognized. 2. If it is Germany (code 49) and the Right Alt (AltGr) key is pressed, then the remote system is sent a press of two keys: Left Ctrl and Right Alt (AltGr).

I think it worked then because that part of the code hadn't changed for a very long time. Could you (or somebody from German here) verify that it doesn't work if you connect to Windows?

And please try the following (it doesn't matter whether it's with Linux or Windows): take this test version:

http://os2.snc.ru/pub/freerdp/test/freerdp-wpi-20250214.zip

Connect to the remote system, press and release the AltGr key, and look at the console. If everything is ok, you should see lines like this:

!TEST! country: 49, codepage: 850
!TEST! Right Alt (pressed) -> Ctrl (0x1D) + Right Alt
!TEST! Right Alt (released) -> Ctrl (0x1D) + Right Alt

If you only see the first line with a different country code, please let me know.

Andi B.

  • Hero Member
  • *****
  • Posts: 887
  • Karma: +15/-2
    • View Profile
Re: FreeRDP keyboard settings / host does not honor German keyboard layout
« Reply #11 on: February 14, 2025, 10:10:28 am »
Edit - reboot required even with BEGINLIBPATH and LIBPATHSTRICT I had to reboot.

Could it be that you're using another libc*? This version does not start here. Even after updating libc*

Quote
================================================================================

 Paket        Arch            Version                  Repository         Größe
================================================================================

Aktualisieren:
 libc         pentium4        1:0.1.13-1.oc00          netlabs-rel        1.0 M
 libcx        pentium4        0.7.4-1.oc00             netlabs-rel         86 k

Vorgangsübersicht
================================================================================

Upgrade       2 Packages

Gesamte Downloadgröße: 1.1 M
Ist dies in Ordnung? [j/N] :j
Lade Pakete herunter:
(1/2): libc-0.1.13-1 | 1.0 MB  00:01     ===  ] 421 kB/s | 902 kB  00:00 ETA
(2/2): libcx-0.7.4-1 |  86 kB  00:00
--------------------------------------------------------------------------------

Gesamt                                          671 kB/s | 1.1 MB     00:01

Running Transaction Check
Führe Verarbeitungstest durch
Verarbeitungstest erfolgreich
Führe Verarbeitung durch
Warnung: RPMDB wurde außerhalb von yum verändert.
  Aktualisieren: 1:libc-0.1.13-1.oc00.pentium4                              1/4

  Aktualisieren: libcx-0.7.4-1.oc00.pentium4                                2/4

  Aufräumen    : libcx-0.7.2-1.oc00.pentium4                                3/4

  Aufräumen    : 1:libc-0.1.9-1.oc00.pentium4                               4/4



Rpmdb checksum is invalid: dCDPT(pkg checksums): libcx.pentium4 0:0.7.4-1.oc00 -
 u

{1}[t:\temp\freerdp_test] chkdll32 ofreerdp.exe
Loading DLL 'libcn0' --> L:\USR\LIB\LIBCN0.DLL.
Unable to load procedure from libcn0 (file: L:\USR\LIB\LIBCN0.DLL)
Ordinal entry 2026 could not be resolved.
DosQueryProcAddr returned: 182
Loading DLL 'doscalls' --> loaded.
Loading DLL 'gcc1' --> L:\USR\LIB\GCC1.DLL.
Loading DLL 'tcpip32' --> L:\MPTN\DLL\TCPIP32.DLL.
Loading DLL 'winpr' --> NOT loaded!
DosExit or exception while loading 'winpr'.
Loading DLL 'freerdp' --> NOT loaded!
DosExit or exception while loading 'freerdp'.
Loading DLL 'mdm' --> L:\MMOS2\DLL\MDM.DLL.
Loading DLL 'pmwin' --> L:\OS2\DLL\PMWIN.DLL.
Loading DLL 'pmgpi' --> L:\OS2\DLL\PMGPI.DLL.
Loading DLL 'pmdrag' --> L:\OS2\DLL\PMDRAG.DLL.
Loading DLL 'pmshapi' --> L:\OS2\DLL\PMSHAPI.DLL.
Loading DLL 'icuuc' --> L:\USR\LIB\ICUUC.DLL.
Loading DLL 'msg' --> L:\OS2\DLL\MSG.DLL.
Loading DLL 'usb100' --> L:\USR\LIB\USB100.DLL.
Loading DLL 'nls' --> L:\OS2\DLL\NLS.DLL.
« Last Edit: February 14, 2025, 10:14:04 am by Andi B. »

Andi B.

  • Hero Member
  • *****
  • Posts: 887
  • Karma: +15/-2
    • View Profile
Re: FreeRDP keyboard settings / host does not honor German keyboard layout
« Reply #12 on: February 14, 2025, 10:18:07 am »
I see -
Quote
!TEST! country: 49, codepage: 850
!TEST! Right Alt (pressed) -> Ctrl (0x1D) + Right Alt
!TEST! Right Alt (released) -> Ctrl (0x1D) + Right Alt
!TEST! Right Alt (pressed) -> Ctrl (0x1D) + Right Alt
!TEST! Right Alt (released) -> Ctrl (0x1D) + Right Alt

But none of the 3th keys work when I connect to a Linux/Debian box. I tried @ € ² ³ ~ tried. Currently I've no /kbd option on command line. Should I try again with /kbd:de,lang:de? My notes says this does not work in the past.

I start with (user/password changed to xxxx) -
Code: [Select]
ofreerdp.exe /u:xxx /p:xxx /w:2100 /h:1600  /v:m92p
« Last Edit: February 14, 2025, 10:20:12 am by Andi B. »

Digi

  • Jr. Member
  • **
  • Posts: 79
  • Karma: +4/-1
  • http://os2.snc.ru/
    • View Profile
    • OS/2 ports and applications
Re: FreeRDP keyboard settings / host does not honor German keyboard layout
« Reply #13 on: February 14, 2025, 11:45:53 am »
IBut none of the 3th keys work when I connect to a Linux/Debian box. I tried @ € ² ³ ~ tried. Currently I've no /kbd option on command line. Should I try again with /kbd:de,lang:de? My notes says this does not work in the past.

I start with (user/password changed to xxxx) -
Code: [Select]
ofreerdp.exe /u:xxx /p:xxx /w:2100 /h:1600  /v:m92p

I can't remember exactly what /kbd affects right now, I think we'll try without it for now (but of course nothing stops you from trying  :) ).

Now I thought - maybe I should send Left Ctrl + Left Alt instead of Left Ctrl + AltGr. If so, you should be able to type "@" by pressing Left Ctrl + Left Alt + q. Try it (but I doubt it).

It would be very interesting to know if AltGr works now on German systems when connecting ofreerdp to Windows...

Andi B.

  • Hero Member
  • *****
  • Posts: 887
  • Karma: +15/-2
    • View Profile
Re: FreeRDP keyboard settings / host does not honor German keyboard layout
« Reply #14 on: February 14, 2025, 02:39:27 pm »
I can't remember exactly what /kbd affects right now, I think we'll try without it for now (but of course nothing stops you from trying  :) ).

Now I thought - maybe I should send Left Ctrl + Left Alt instead of Left Ctrl + AltGr. If so, you should be able to type "@" by pressing Left Ctrl + Left Alt + q. Try it (but I doubt it).

It would be very interesting to know if AltGr works now on German systems when connecting ofreerdp to Windows...
Yes I think you should send AltGr when AltGr is pressed and Ctrl + Alt when that keys are pressed. Ctlr + AltGr - I think this combination is not needed/used for anything.

Of course I tried both, the old way Ctrl + Alt like with old keyboards that don't even have AltGr key and the AltGr (+ E = € or + Q = @...). I think I've also tested the ver old way Alt + (NumberKeyBlock keys 6 + 4) which should result in @ too. Nothing worked. Unfortunately currently no Win target to test with. Maybe I can manage this in the next days.