Re: What's wrong with keyCode and String.fromCharCode
- From: "VK" <schools_ring@xxxxxxxxx>
- Date: 27 Feb 2006 09:51:44 -0800
Pugi! wrote:
It is example of adding an eventlistener to a textarea. The events works
alright, but when I press 'a' the alert gives me 'A', when I press '8' I get
'h', when I press '0' I get ''', when I press 'à' I get '0', ....
Has probably something to do with the fact that I don't live in the UK or
USA. But it shouldn't matter; a key is a key.
No it's not ;-) Do not mix keyboard *scancodes* with *keycode*.
Scancode is the system value assigned to each key on your keyboard.
This value is indead layout-independent. Keycode is Unicode value going
to receiver: it depends on current layout, shift state etc.
In your particular case though it may help to monitor 'okeypress'
instead of 'onkeydown' as you're doing right now.
.
- Follow-Ups:
- References:
- Prev by Date: Re: Ajax Problem
- Next by Date: Deselecting text in input text box
- Previous by thread: What's wrong with keyCode and String.fromCharCode
- Next by thread: Re: What's wrong with keyCode and String.fromCharCode
- Index(es):