Windows 10 idle lock screen: keyboard keypress not detected
The probable explanation is that the lock screen does not have focus, so when you click you are regaining focus. Try entering alt+tab or ctrl+alt+del to test if this is really the case and if the keyboard is still reactive. If it is, then this is a bug by Microsoft that will probably be fixed in some future time.
If your keyboard is connected via USB, a setting that might help is "USB Selective Suspend". This allows the operating system to place a single USB port into low-power mode, rather than staying on or completely shutting off all USB ports. Try to disable it by doing the opposite of the procedure described in the article Windows 10 – How to Enable USB Selective Suspend.
Check if your in power save mode (Most systems enable by default nowadays).
Device manager> Keyboards (Choose yours)> Properties> Power Management> See if the check box is checked for "Allow this device to wake the computer"
If this is the case check drivers and also updates. Sometimes there is an "Oops we missed something or broke something" update soon after. Also if after an update it happens check that option again since it sometimes resets.
Ive used Bluetooth, USB, and a PS2 keyboard with success but had this issue once and it was due to that being unchecked.
Hope this helps