A mouse is connected and I am not using the built in track pad on my macbook. Occasionally while typing I inadvertently touch the trackpad, the cursor moves to some random spot in my typing without me noticing and the new input is somewhere between everything else.
Going to the Trackpad tab in System Preferences has the Ignore accidental trackpad input box checked, but makes no difference for me.
The answer is to go to Mouse and track pad under Universal Access in System preferences. Click Ignore built in track pad when mouse is present.
It would be better if the previous solution actually worked as advertised (am I missing something here?) But this solution is the best I have found.