We had the same issue. Replaced a corrupted CEAPI.DAT file and soon after, some keyboards (and some trackpads) stopped functioning as described above.
In each case, it was clear there was a spyware infection that was getting 'fixed', and in turn breaking the internal keyboard...
In our case, I was able to trace the issue to an infection detected by the Win32.Trojan.Agent definition and found in vulscan logs that it 'fixed' 2 reg keys that looked related to keyboard functionality:
HKLM\SYSTEM\CurrentControlSet\services\kbdclass
HKLM\SYSTEM\CurrentControlSet003\services\kbdclass
I compared the entries on the broken system to a working laptop of the same model. I also compared the seemingly unaffected CurrentControlSet001/002 on the broken system.
I recreated the kbdclass and sub keys (Enum/Parameters) for both affected CurrentControlSet keys. Reboot, and it the keyboard worked again! No system restore needed.