Device Error

It may be that there is something in the sketch you uploaded that messed up your Pro Micro's USB functionality.

Try this:

File > New

Connect a wire to the reset pin on your Pro Micro and be ready to momentarily connect the other end of that wire to the ground pin.

Sketch > Upload

Watch the black console window at the bottom of the Arduino IDE window until you see something like this:

Sketch uses 3462 bytes (12%) of program storage space. Maximum is 28672 bytes.
Global variables use 149 bytes (5%) of dynamic memory, leaving 2411 bytes for local variables. Maximum is 2560 bytes.

Quickly connect the reset pin to ground and then disconnect it.

The upload should now finish successfully and your board should be recognized again. After this, you should be able to go back to uploading to the board normally again. If you upload the problematic sketch it may cause the problem to return. At a glance, I don't see anything about that sketch that would cause a problem. You could try running it without the Mouse library code to narrow down the cause of the error.