I was having a very strange problem today in Ubuntu 10.04 (Lucid Lynx). All my keystrokes in keyboard were delayed. I am bit kind of touch typist and when I type I type a bit faster. My problem was none of the letters I typed were typed actually. I would have to hold a key to have it typed.

I backtracked all my works, my installation that I could remember of then suddently I found the solution, One of the option for press and hold keys (Fow Slow keys) was enabled. I unmarked that option and everything was back to normal.

Solution:

1. Click System > Preference > Keyboard

2. Select Accessibility

Then tick mark [x] Accessibility features can be toggled with keyboard shortcuts

If this is already marked, then you will get a icon in gnome-panel at right.

Open Universal Access Preference, Unmark the option that says
[ ] Press and hold keys to accept them (Slow Keys)