I was trying to install Ubuntu, so I booted the PC from a USB device. I eventually did not install Ubuntu and when I restarted the PC it booted into Windows 10 as per usual. Everything seemed fine until I had to login - my mouse and keyboard were not working.
The red LED under the mouse was also shut off.
I then changed a couple of settings in the BIOS: I turned ON legacy USB support and I checked if all the USB ports were active - which they were. Then I switched fast boot off. Still not working.
I also tryied different mouses and keyboards but they all weren't working. I tryied plugging the devices into different ports with the same result.
I managed to start the startup repair by cutting off the power when the PC was booting. Mouse and keyboard WORKED there.
I reinstalled Windows, loosing most of my programs, but that did it. Mouse and keyboard worked again like they always did.
The thing is: I want to install Ubuntu alongside Windows. Now I'm scared of doing it. I don't want to reinstall Windows like I did before. What may have caused the issue? How can I prevent it?