Is it a laptop, does it have a touchpad below the keyboard, are you accidently hitting the touchpad while you type?
I used to do this alot :-( , as a single tap on the touchpad counts as a click, and I often catch the touchpad with the edge of my hand sending the cursor elsewhere.
Depending on your OS and drive, you might have an option to disable the touchpad when an external pointing device is plugged in.