As said in the comments, it’s hard to help much without details of hardware (eg laptop with built-in keyboard, or desktop with usb keyboard); I note you said you tried reinstalling drivers etc but we haven’t got details of what commands you ran to do that or what other fixes you tried. You may also have a clue as to what caused the problem - eg recent change of hardware, recent upgrade etc.
I appreciate it may be by challenging to get the data to us using an on screen keyboard so here are a few suggestions that might help; apologies if they’re obvious to you - I don’t know how confident / competent you are:
(1) try to confirm if hardware or driver issue - so if it’s a laptop, try an external keyboard; if already using a usb keyboard, try it in a different USB port and if that doesn’t help, try a different keyboard.
(2) I’d also try a live usb Ubuntu session - (a) to see if the keyboard then works, but (b), if it is an issue with the current Ubuntu installation, you can at least type some commands and save to usb to then paste into your defective installation’s terminal to try to resolve it without having to type everything using the on screen keyboard, and (c) you may then be able to edit your question if you can get your keyboard working in a live session in order to provide more information for us to answer.
(3) if it’s not a hardware fault, it may be easier just to perform a fresh install - you can copy all your data to external drive from the current installation because it at least boots up, so you shouldn’t lose any data, though obviously it’ll take some time.
I hope that helps - good luck!