Do in a terminal window:
rpi-keyboard-config unlock
When waiting for Esc+Enter on the Raspberry Pi 500 to unlock the keyboard nothing happens when you type on the keyboard and not even the off/on button works. One way to fix this is to press Esc+Enter on Raspberry Pi 500. Pressing Esc+Enter does not work if the terminal window is closed while waiting for unlock; then rebooting or shutting down or restarting doesn't help. You cannot use the power button to start the shutdown computer. The only solution then AFAIK is to shutdown and pull the plug and insert it again. Then the keyboard works again.
I think this unlock procedure should be interrupted by shutting down or rebooting the computer so that the keyboard would always work after shutdown or reboot. Maybe the unlock procedure could also be stopped by pressing the power button. Maybe the unlock procedure should time out by itself even if the terminal window is closed.