I have a Dell XPS 13 with Ubuntu 18.04 installed. I have the install encrypted and when I get to the encryption password prompt the keyboard works fine, then when I get to the login screen keyboard is unresponsive. Brightness/backlight keys work, but most other things do nothing. I noticed if I put the laptop to sleep at the login screen, after waking it up the keyboard works as expected.
sudo apt-get install --reinstall xserver-xorg-input-all with no luck.