How about this which I found with a google of "weird mouse behavior"

It is possible that you have been infected by a malware (virus, trojan, etc), because it's possible to "control" the mouse through coding by modify mouse messages.

My suggestion is to start Windows in safe mode to avoid running any third party programs/drivers when you logged on. In safe mode you can check your mouse behaviour. Check several times (logging out and logging in back again in safe mode a few times). If in all safe mode sessions the mouse is acting properly then you definitely infected by some malware. It's possible that the malware was written poorly resulting that weird mouse behavior.

Oh, while you are in safe mode, you may want to remove any autorun programs to avoid that malware gets activated again. You can use a startup manager like Start-Q to do the removal, and then run antivirus to find out what malware infected you.