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;