[Bug][Windows] CapsLock shift bit is missing from command chords
Environment
Windows; Neomacs with the winit fork patch branch at 598fe4b1 (the pin from #761).
Reproduction
With CapsLock on and physical Shift released, press Ctrl+Alt+n or Ctrl+n.
GNU Emacs 31.1 (w32) produces a Shift-modified event (C-M-S-n / C-S-n). Neomacs produces C-M-n / C-n, so a user binding on the GNU event does not fire.
GNU Emacs source
src/w32fns.c:10162-10187: w32_kbd_mods_to_emacs adds shift_modifier when SHIFT_PRESSED or CAPSLOCK_ON is set, except for VK_BACK, VK_TAB, VK_CLEAR, VK_RETURN, VK_ESCAPE, VK_SPACE..VK_HELP, VK_NUMPAD0..VK_F24, and the numpad navigation block.
Root cause
winit's ModifiersState does not expose CapsLock. The Windows layout lookup includes CAPS_LOCK, so the logical key is the uppercase N, but the event carries no Shift. Neomacs's normalize_command_character_case reads the uppercase letter as CapsLock and lowercases it, clearing the Shift bit.
Fix direction
Expose the lock state per key event at the winit Windows boundary (for example a caps_lock field on KeyEvent), then apply GNU's exclusion list when cooking the shift modifier. Add a regression for a command-letter chord with CapsLock on and physical Shift released.
This is pre-existing and also affects Ctrl+<letter>; #761 documents it under Limitations and does not change it.
Closing. A closer reading of the GNU Emacs 31.1 source (commit a360712c9d) shows the premise of this issue was wrong. Neomacs already matches GNU here.
For a Ctrl/Alt + letter chord with CapsLock on and Shift released, GNU's w32_wnd_proc first lowercases the key, since Shift isn't physically pressed (src/w32fns.c:4897: wParam += ('a' - 'A')). It then posts the chord as WM_CHAR with w32_get_key_modifiers (wParam, ...) (:4964). The lowercased 'n' is 0x6E, which falls inside the VK_NUMPAD0..VK_F24 range (0x60–0x87) that w32_kbd_mods_to_emacs excludes from the CapsLock-adds-Shift rule (:10166-10175). So only the physical Shift state counts, and GNU produces plain C-n / C-M-n / M-n, the same as Neomacs.
GNU's CapsLock-as-Shift only shows up for function keys outside that exclusion list. We don't have a Windows machine, so this is a source reading, not an observed run. If you see a chord on Windows that differs from GNU Emacs 31.1, please reopen with the exact key and both results.