The problem is Ubuntu thinks your PC is a tablet and diables the keyboard.
The fix below works if the following command gives you any number that is not 31 or 32.
cat /sys/class/dmi/id/chassis_type
How to fix this: (from https://askubuntu.com/a/1282269/558457)
There is a bug in recent kernels that disables some laptop keyboards. Mainly Acer and HP so far. Can usually go to recovery and boot from kernel 5.4.0-42 or use an external keyboard.
Blacklisting the intel_vbtn kernel module is a workaround for this, as seen in Why my laptop's keyboard screwed up since kernel 5.4.0-47 till 5.8.0-20
To implement this, you can either create a new file in /etc/modprobe.d with the suffix .conf or use the main blacklist.conf file. The former may be preferable, since you can then just delete the file when it is no longer required (i.e. when the bug is fixed):
sudoedit /etc/modprobe.d/blacklist-intel_vbtn.conf
Add a line to the file, optionally with a comment explaining why you are doing this
# bug in module breaks keyboard, so don't load it
blacklist intel_vbtn
Save the file, exit and reboot.