I just encountered a similar issue on Windows 11 Entreprise version 23H2:
1 - Keyboard working fine in all apps ...
When I type on my keyboard, character appears : normal behavior.
This works fine in Chrome. and other apps
2 - .. EXCEPT some 'Windows places ' ( all related to explorer.exe ? )
But it DOESN'T work when I try to type in the 'Search Field' of the 'Windows Main Menu" (menu which appears when hitting the 'Windows' button)
It also DOESN'T work in Windows's Settings app.
**3 - Solution:**I killed and restarted the explorer.exe process then all came back to normal:
keyboard is working correctly in all apps back again.
Note:
Could this this problem be related to this old issue "Keyboard not working in system apps" ?
https://answers.microsoft.com/en-us/windows/forum/all/keyboard-not-working-in-system-apps/04eea0a7-31f6-41b6-a2d0-a7362f29164b