JQuery keypress event is giving odd charachters?

KeyCode is not the same as a charCode, they are different maps (And differ somewhat between browsers with arrow keys and such). Think about it this way, what letter is Escape, or Delete?

That is right. For instance, keyCode 13 means the enter key, if my memory is still working... So you must figure out the mapping between English letters to their corresponding keycode so to finish the code. – Michael Mao Feb 25 '10 at 23:15.

You can't use String.fromCharCode() for this purpose. You can write your own function that could recognize the characters.

Change keyCode to charCode and Your code works. But this might not be a good idea - it's not cross browser I think. And it returns non-ascii chars as well (when you click tab key etc.) so you'd have to filter them out.

If You wanted a practical application try using an input field and get its text on keypress or something like that.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions