microsoft / wslg

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

Neo keyboard layout with locked level when switching windows #749

Open catchin opened 2 years ago

catchin commented 2 years ago

Environment

Windows build number: 10.0.22000.0
Your Distribution version: Debian 11
Your WSLg version: 1.0.26 (on WSL 5.10.102.1)

Steps to reproduce

See WslLogs-2022-05-27_14-46-52.zip

WSL logs:

Expected behavior

Actual behavior

Is it possible to prevent the initial Level-4 locking from happening, because it is tedious to unlock Level-4 each time switching windows?

What I tried

As related issue

I use the Neo Layout with NeoQwertz variant, but it is identified by WSLg as Neo variant. As a workaround, a setxkbmap de neo_qwertz fixes the issue. Is it possible to identify the keyboard layout variant correctly?

KrotanHill commented 1 year ago

I experienced the same issue with the normal Neo-Layout/Variant (kbdneo64.zip).

catchin commented 1 year ago

I just checked the status on the latest WSL version:

WSL-Version: 1.2.5.0
Kernelversion: 5.15.90.1
WSLg-Version: 1.0.51
MSRDC-Version: 1.2.3770
Direct3D-Version: 1.608.2-61064218
DXCore-Version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows-Version: 10.0.22621.2215

And noticed one difference: When disabling ReNeo and using setxkbmap de neo_qwertz, I am stuck in Level-4 and cannot even unlock it.

With ReNeo + kbdneo active, typing is normal for most characters but a few notable exceptions that still render the keyboard layout useless, most notably \[]{}| (but others like /() work).

If I check the keyboard events using xev -event keyboard for this case and if I want to type { (Mod-3+d) I get:

KeyPress event, serial 35, synthetic NO, window 0x600001,
    root 0x22e, subw 0x0, time 2075033, (-423,-504), root:(523,1116),
    state 0x94, keycode 16 (keysym 0x7b, braceleft), same_screen YES,
    XLookupString gives 1 bytes: (1b) "

mbLookupString gives 1 bytes: (1b) "

FilterEvent returns: False

whereas for / (Mod-3+s) I get:

KeyPress event, serial 35, synthetic NO, window 0x600001,
    root 0x22e, subw 0x0, time 2073951, (-423,-504), root:(523,1116),
    state 0x11, keycode 16 (keysym 0x2f, slash), same_screen YES,
    XLookupString gives 1 bytes: (2f) "/"
    XmbLookupString gives 1 bytes: (2f) "/"
    XFilterEvent returns: False

Anyone has a hint how to debug it further or what the issue could be?

dhermanns commented 1 year ago

Any update on this case?

kescherCode commented 11 months ago

If the numpad light on your keyboard is on, it locks Layer 4. This is the core of the issue, since that's where the Windows NeoQwertz implementation and the Linux one differ.

(Also documented here, along with a workaround for the failing automatic keyboard mapping: https://github.com/microsoft/wslg/issues/1023#issuecomment-1827539837)