I suggest this part of the article named One or more keys on the keyboard do not respond found here http://support.apple.com/kb/ts1381
Some keys don't work as expected
- From the Apple menu, choose System Preferences.
- From the View menu, choose Speech.
- Click the Text to Speech tab.
- If "Speak selected text when the key is pressed" is enabled, the key or key combination set to speak text cannot be used for other purposes or used to type text--click Set Key and change it to a less-commonly used key combination (try to use modifier keys such as Shift, Command, Option, and Control). Or, disable the "Speak selected text when the key is pressed" option.
- Click the Universal Access pane in System Preferences, click the Keyboard tab.
- Make sure that Slow Keys is turned off. With Slow Keys on, you need to press a key for a longer period of time for it to be recognized.
- In the Universal Access pane, click the Mouse tab, and make sure Mouse Keys is turned off. With Mouse Keys enabled, you cannot use the Numeric Keypad to enter numbers--instead the keypad moves the pointer (cursor). (There is an option to enable Mouse Keys with five presses of the Option key; you may want to turn that option off to avoid accidentally enabling it.) If Mouse Keys is enabled and you are using a keyboard with no numeric keypad or Num Lock function, see Unable to type while Mouse Keys is enabled in Mac OS X.
- If the function keys on the top row of the keyboard are not working as expected, see Mac OS X: How to change the behavior of function keys.
- If the issue persists, use Keyboard Viewer to help isolate the issue:
- Click the Language & Text pane (Mac OS X v10.6) or International pane (Mac OS X v10.5.8 or earlier) in System Preferences.
- Click the Input Sources tab (or Input Menu tab in Mac OS X 10.5.8 or earlier).
- Click the Keyboard & Character Viewer "On" checkbox to select it (click the Keyboard Viewer "On" checkbox in Mac OS X 10.5.8 or earlier).
- From the Input (flag) menu, choose Show Keyboard Viewer.
- If the keyboard is connected and detected by Mac OS X, the keys you type will highlight in the Keyboard Viewer window. Open TextEdit (or any text application), and try to type something using the keys that were previously not responding to see if they highlight in Keyboard Viewer.
- Start from the Mac OS X Install Disc, choose Terminal from the Utilities menu and test the keys which were previously not working. If the keys work while started from the Install disc, then the keyboard itself is working correctly. Use Mac OS X: How to troubleshoot a software issue to isolate the software issue that may be causing the keys to not respond.
All the very best,
When I log out and log in as a differnt user the problem with the keyboard is fixed.
This usually indicates you have a bad .plist file in Home/Library/Preferences for your main user account. Which one it might be I don't know. If you can figure that out, trashing the .plist will cause a new, good one to be generated when you restart.