Well, each device will need to be investigated one by one.
We will need:
- The syslog from /var/log/syslog
- The output of listusb (or lsusb running Linux on the same machine)
- The HID descriptor for your keyboard if it’s USB (it’s located in /tmp)
- The output of listdev (or lspci running on the same machine, with flags to show the numeric PCI IDs)
When keyboard doesn’t work, you can use the keymap preferences as a cheap on-screen keyboard (type something in the test area, then copy-paste to terminal, or drag and drop keys to terminal). It’s quite painful, but we have to start with something.