If the computer still has a PS2 port for keyboard, you can interrupt the boot and get into safemode if its just a driver issue at boot because PS2 support is ready to run prior to USB connectivity on some computers. If your computer doesnt have legacy support for a PS2 connection you will have to interrupt it with a bootable device like a bootable flash drive or a bootable CD or DVD that would give you access to Mouse/Keyboard use via USB connectivity and then repair the issue that you have going on from an alternately loaded OS.
Do you have the system recovery media that can be created after purchase of a prebuilt computer? If you have this you can boot the media and perform a recovery that keeps your existing data or blows away all data and installs back to a clean state. *Note: If this computer was originally Windows 7, 8, or 8.1 and the driver issue occurred after an upgrade to Windows 10 you may have to install the original OS and then perform the upgrade again to 10 and then avoid the driver update that caused the crash condition.
I have an older laptop for example that will run fine on clean build of Windows 10 which originally was sold with Windows 7 and the touchpad driver that the system wants to update via a later Windows update causes the keyboard to type wrong keystrokes. I have since had to roll back to Windows 7 with it because there is no Windows 10 compatible driver for the touchpad and the fixes online dont help. Additionally if a USB keyboard is attached to my laptop it still types all wrong due to touchpad driver issue.