Issue 421304 in chromium: Wrong keyCode for UK keyboard

8 views
Skip to first unread message

chro...@googlecode.com

unread,
Oct 8, 2014, 12:31:11 AM10/8/14
to chromi...@chromium.org
Status: Assigned
Owner: shuc...@chromium.org
Labels: Type-Bug Pri-2 Cr-UI-Input-Text-IME OS-Chrome M-40

New issue 421304 by shuc...@chromium.org: Wrong keyCode for UK keyboard
https://code.google.com/p/chromium/issues/detail?id=421304

Version: R40
OS: ChromeOS/Linux

Enable "UK keyboard" in ChromeOS or "gb" XKB layout in Linux.

Use http://jsfiddle.net/laelitenetwork/zrz141ox/ to verify the keyCode.

#~ is giving 220 (should be 222)
'@ is giving 222 (should be 192)



--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

chro...@googlecode.com

unread,
Oct 8, 2014, 12:33:11 AM10/8/14
to chromi...@chromium.org
Updates:
Cc: yukishi...@chromium.org

Comment #1 on issue 421304 by shuc...@chromium.org: Wrong keyCode for UK
keyboard
https://code.google.com/p/chromium/issues/detail?id=421304

This is from issue 386066.

chro...@googlecode.com

unread,
Oct 9, 2014, 11:54:07 PM10/9/14
to chromi...@chromium.org
Updates:
Status: Fixed

Comment #3 on issue 421304 by shuc...@chromium.org: Wrong keyCode for UK
keyboard
https://code.google.com/p/chromium/issues/detail?id=421304

(No comment was entered for this change.)

chro...@googlecode.com

unread,
Oct 28, 2014, 4:32:52 AM10/28/14
to chromi...@chromium.org

Comment #4 on issue 421304 by Michael....@gmail.com: Wrong keyCode for UK
keyboard
https://code.google.com/p/chromium/issues/detail?id=421304

Should this be working in ChromeOS 40.2194.3 (released 22nd Oct)?

Language English (UK)
Keyboard: US

'" is giving 222 (should be 192)
`~ is giving 192 (should be 223)

chro...@googlecode.com

unread,
Oct 28, 2014, 5:19:52 AM10/28/14
to chromi...@chromium.org

Comment #5 on issue 421304 by shuc...@chromium.org: Wrong keyCode for UK
keyboard
https://code.google.com/p/chromium/issues/detail?id=421304

"Keyboard: US"? I think you should switch to UK keyboard and try again.

chro...@googlecode.com

unread,
Oct 28, 2014, 5:28:53 AM10/28/14
to chromi...@chromium.org

Comment #6 on issue 421304 by Michael....@gmail.com: Wrong keyCode for UK
keyboard
https://code.google.com/p/chromium/issues/detail?id=421304

I'm testing (this time) on a Chromebook with a US keyboard ie it has 2@ '"
`~ keys (not `¬ 2" '@ #~)

I've just Powerwiped and there are independent settings for Language and
Keyboard on startup so I selected
Language: English (UK)
Keyboard US (as it's a US keyboard)

'" is giving 222 (should be 192)
`~ is giving 192 (should be 223)
(no #~ key so can't test that obviously :)

chro...@googlecode.com

unread,
Oct 28, 2014, 5:33:54 AM10/28/14
to chromi...@chromium.org

Comment #7 on issue 421304 by shuc...@chromium.org: Wrong keyCode for UK
keyboard
https://code.google.com/p/chromium/issues/detail?id=421304

Please go chrome://settings/languages, and click English or English (United
Kingdom), on the right side, enable the checkbox for "UK keyboard".

Open system tray menu, click "US keyboard", and then activate "UK keyboard".

chro...@googlecode.com

unread,
Oct 28, 2014, 5:36:54 AM10/28/14
to chromi...@chromium.org

Comment #8 on issue 421304 by Michael....@gmail.com: Wrong keyCode for UK
keyboard
https://code.google.com/p/chromium/issues/detail?id=421304

No, if I do that then eg Shift-2 gives the wrong character when typing
normally. It's a legitimate (and correct) setting to have Language: UK,
Keyboard: US

chro...@googlecode.com

unread,
Oct 28, 2014, 5:42:52 AM10/28/14
to chromi...@chromium.org

Comment #9 on issue 421304 by shuc...@chromium.org: Wrong keyCode for UK
keyboard
https://code.google.com/p/chromium/issues/detail?id=421304

The keyCode for the key events are actually bound to the keyboard layout,
instead of language.
So until you fully switch to UK keyboard, the keyCode remains according to
US-qwerty-layout, so '" is giving 222 & `~ is giving 192 are correct and
intended.

chro...@googlecode.com

unread,
Oct 31, 2014, 11:23:26 AM10/31/14
to chromi...@chromium.org

Comment #10 on issue 421304 by Michael....@gmail.com: Wrong keyCode for UK
keyboard
https://code.google.com/p/chromium/issues/detail?id=421304

Thanks for checking - I assumed that the Apostrophe and Backtick keys would
give the same codes for US and UK in Chrome (as they do in Firefox)

This seems to work around the inconsistencies:
if (isFirefox) {
keyCodes.SEMICOLON = 59;
// #~ key (not on US keyboard)
keyCodes.HASH = 163;
keyCodes.APOSTROPHE = 222;
keyCodes.BACK_QUOTE = 192;
keyCodes.MINUS = 173;
keyCodes.EQUALS = 61;
} else {
// Chrome
keyCodes.SEMICOLON = 186;
// #~ key (not on US keyboard)
keyCodes.HASH = isUKlayout ? 222 : 223;
keyCodes.APOSTROPHE = isUKlayout ? 192 : 222;
keyCodes.BACK_QUOTE = isUKlayout ? 223 : 192;
keyCodes.MINUS = 189;
keyCodes.EQUALS = 187;
Reply all
Reply to author
Forward
0 new messages