I had this when typing text into Thunderbird. I replaced the motherboard's built-in graphics system with a decent graphics card and the problem was resolved. I know a basic graphics system should cope easily with text, but for whatever reason it didn't.
A new graphics card has fixed this problem for me in the past, also depending on how fast (or slow) it really is going it could be your keyboard. The low profile keyboards that HP ships with all of their stuff are very slow, some of the worst keyboards I've ever had to use, and I don't have anything else against HP in any way for the record.