This can often happen if you're using a laptop with a particularly sensitive touchpad. As you type you may be inadvertently catching the pad with your palm and moving the cursor to a random point. Try changing the touchpad settings or just be careful not to touch the pad when you type. Or you may want to install 'Touchfreeze' which disables the touchpad when you type. A link to a description and download is here:
touchfreeze | PCWorld
Good luck.