But then when I use on screen keyboard the problem is not there.
The problem is going to be hardware or software based. Which one you're
dealing with, I don't know. Take a look at these references:
A lightweight outline of troubleshooting keyboard problems in this sample
Que book chapter:
http://www.quepublishing.com/articles/article.asp?p=340876&seqNum=6
A discussion about keyboard troubleshooting (some more advanced techniques
referred to):
http://www.experts-exchange.com/Hardware/Laptops_Notebooks/Q_20863710.html
A readme for a Linux keyboard mapping utility. Gives an idea of how
software copes with the builtin hardware functions. Also gives an insight
as to how and why software can be used to achieve desired output:
http://leuksman.com/linux/README.keymap
Hardware possibilities:
Be very sure that this keyboard is okay. Something as innocent as a pet
hair or a strip of cellophane that has slipped under the keys can cause
unwanted contact. The contact can act as a "short" and cause incorrect
signals and output.
If the problem is truly not the keyboard, it may other hardware that
communicates with the keyboard that is faulty. Including the port that the
keyboard connects to on the motherboard or its underlying circuitry. It is
difficult to test these things without special diagnostic equipment. May
need to have a shop do the forensics for you.
Software:
Check language settings in Windows for keyboard.
Try reinstalling keyboard driver. Preferably one from the manufacturer's
site instead of one included in Windows driver base.
If you have installed software that remaps the characters a keyboard
produces, it's possible it is misfiring and causing this problem. Even if
the software has been uninstalled, it may have left something behind that
is still effecting the keyboard output. If remap software has been used,
consult tech support for that program.
It sounds like your codepage file is in good shape since a software
keyboard works correctly.
There may be other explanations but I can't think of any at the moment.
A very odd problem. If you get this sorted, would be interested in hearing
what the ultimate solution was.