microsoft / wslg

Enabling the Windows Subsystem for Linux to include support for Wayland and X server related scenarios
MIT License
10.26k stars 310 forks source link

Adding fr-bepo keyboard layout support #696

Open raylemon opened 2 years ago

raylemon commented 2 years ago

Environment

Windows 11 Win32NT 10.0.22000.0 Microsoft Windows NT 10.0.22000.0 WSL Arch Linux WSLg 2

Run any app in wslg mode (like emacs) . Keyboard in WSLg still US (in non graphic mode, keyboard is recognized)

WSL logs:

[10:57:25.383] convert_rdp_keyboard_to_xkb_rule_names: matching layout=(null) variant=(null) options=(null) [10:57:25.383] rail_client_LanguageImeInfo_callback: Failed to switch to kbd_layout:0xb001040c kbd_type:0x4 kbd_subType:0x0

Expected behavior

Fr-bepo language must be recognized in wslg apps

hideyukn88 commented 2 years ago

@raylemon, thanks for reporting the issue. If I understand correctly, French-BÉPO layout (https://en.wikipedia.org/wiki/B%C3%89PO) is not one of Windows Standard layout (https://docs.microsoft.com/en-us/globalization/windows-keyboard-layouts). Have you installed 3rd party keyboard layout driver? Thanks!

raylemon commented 2 years ago

Yes, I have 3rd party driver for Windows. All Linux distros have the fr-bepo layout. If I add the layout in weston.ini, it’s working, but I need to redo the commands at every start.

hideyukn88 commented 2 years ago

@raylemon, the problem here is that the remote desktop protocol informs the client keyboard layout to WSLg by keyboard layout ID, and the ID can't be consistent/unique in 3rd party keyboard layouts, that said it's possible there is other 3rd party French keyboard layout can have same ID as the layout you are using, but different layout, or other 3rd party fr-bepo layout has different ID. Thus for now, you will need to have workaround to set layout at every startup. This can be solved either by 1) Windows supports fr-bepo layout officially (so ID is assigned by Microsoft) or 2) WSLg supports the solution for https://github.com/microsoft/wslg/issues/173.

bateast commented 1 year ago

Hello, now that

  1. Microsoft has announced the support of bépo (Microsoft blog), and upstream
  2. Weston source reference (Weston rdp map) has been including bépo for years (RDP reference implementation)

What and when can we expect ? A weston update could be needed (rdp map does not includes bépo though its reference does)…

hideyukn88 commented 1 year ago

@bateast, thanks for reminding us!

bateast commented 11 months ago

Hello, thank you for the update.

Shouldn't it be bepo_afnor on line 882 ? https://github.com/microsoft/weston-mirror/blob/70cbfad51df2b4cd62fd5a6f98f596a787250c66/libweston/backend-rdp/rdp.c#L881C24-L882C1

Especially given AltGr-Space (Alt-Space actually…) is inaccessible in WSL, underscore can not be used in deprecated bépo 1.0. (https://github.com/microsoft/wslg/issues/1068 — actually a big deal for Linux apps…)