If your keyboard seems to take a keystroke to “wake up” on Linux it could be USB power-saving. If the output of cat /sys/module/usbcore/parameters/autosuspend is not -1, you can disable this by adding the kernel parameter usbcore.autosuspend=-1 and rebooting.