If it's an optical mouse then I'd say make sure you're using a non-reflective mouse mat as I've had similar problems with the cursor shooting across the screen (very annoying when working in photoshop

).
If it's not that then I'd look into the drivers being used for your mouse and/or keyboard in Device Manager.
Cheers,
Andy