1. Some Javascript is probably moving the keyboard focus to a certain text box on the page, and if you click a text box really fast before it gets a chance, it will possibly move the focus somewhere unexpected. Gmail does this for example. Wait for the page to load entirely in your browser before you start typing.

2. Could be a crappy optical mouse. Could be an intruder taking over your machine remotely. Or anything in between.