Open Bug 673379 Opened 13 years ago Updated 2 years ago

event.keyCode returns wrong code on United Kingdom keyboard

Categories

(Core :: DOM: Events, defect, P3)

x86_64
Linux
defect

Tracking

()

UNCONFIRMED

People

(Reporter: hkelsey, Unassigned)

Details

On a United Kingdom keyboard event.keyCode in onkeydown returns 51 for both the 3/£ key and the #/~ key. On windows this working correctly, 51 is returned for the 3/£ key and 222 for the #/~ key.
Mozilla/5.0 (X11; Linux x86_64; rv:8.0a1) Gecko/20110815 Firefox/8.0a1 Have you tried this issue on other browsers as well? Does the issue still occur if you start Firefox in Safe Mode? http://support.mozilla.com/en-US/kb/Safe+Mode How about with a new, empty profile? http://support.mozilla.com/en-US/kb/Basic+Troubleshooting#Make_a_new_profile How did you test this issue? What site did you use in order to check the codes?
It occurs on chrome as well, it was tested on our webapp but is simple to reproduce just use event.keyCode.
Can you use event.key instead? It seems .keyCode has its problems and is deprecated. https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode
Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.