--- a/testing/mochitest/tests/SimpleTest/NativeKeyCodes.js
+++ b/testing/mochitest/tests/SimpleTest/NativeKeyCodes.js
@@ -5,16 +5,23 @@
*/
// Windows
// Windows' native key code values may include scan code value which can be
// retrieved with |((code & 0xFFFF0000 >> 16)|. If the value is 0, it will
// be computed with active keyboard layout automatically.
// FYI: Don't define scan code here for printable keys, numeric keys and
// IME keys because they depend on active keyboard layout.
+// XXX: Although, ABNT C1 key depends on keyboard layout in strictly speaking.
+// However, computing its scan code from the virtual keycode,
+// WIN_VK_ABNT_C1, doesn't work fine (computed as 0x0073, "IntlRo").
+// Therefore, we should specify it here explicitly (it should be 0x0056,
+// "IntlBackslash"). Fortunately, the key always generates 0x0056 with
+// any keyboard layouts as far as I've tested. So, this must be safe to
+// test new regressions.
const WIN_VK_LBUTTON = 0x00000001;
const WIN_VK_RBUTTON = 0x00000002;
const WIN_VK_CANCEL = 0xE0460003;
const WIN_VK_MBUTTON = 0x00000004;
const WIN_VK_XBUTTON1 = 0x00000005;
const WIN_VK_XBUTTON2 = 0x00000006;
const WIN_VK_BACK = 0x000E0008;
@@ -172,17 +179,17 @@ const WIN_VK_LAUNCH_APP1
const WIN_VK_LAUNCH_APP2 = 0xE02100B7;
const WIN_VK_OEM_1 = 0x000000BA;
const WIN_VK_OEM_PLUS = 0x000000BB;
const WIN_VK_OEM_COMMA = 0x000000BC;
const WIN_VK_OEM_MINUS = 0x000000BD;
const WIN_VK_OEM_PERIOD = 0x000000BE;
const WIN_VK_OEM_2 = 0x000000BF;
const WIN_VK_OEM_3 = 0x000000C0;
-const WIN_VK_ABNT_C1 = 0x000000C1;
+const WIN_VK_ABNT_C1 = 0x005600C1;
const WIN_VK_ABNT_C2 = 0x000000C2;
const WIN_VK_OEM_4 = 0x000000DB;
const WIN_VK_OEM_5 = 0x000000DC;
const WIN_VK_OEM_6 = 0x000000DD;
const WIN_VK_OEM_7 = 0x000000DE;
const WIN_VK_OEM_8 = 0x000000DF;
const WIN_VK_OEM_NEC_DP1 = 0x000000E0;
const WIN_VK_OEM_AX = 0x000000E1;
--- a/widget/tests/test_keycodes.xul
+++ b/widget/tests/test_keycodes.xul
@@ -2842,20 +2842,20 @@ function* runKeyEventTests()
"|", "Backquote", nsIDOMKeyEvent.DOM_VK_PIPE, "|", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
yield testKey({layout:KEYBOARD_LAYOUT_NORWEGIAN, keyCode:WIN_VK_OEM_5,
modifiers:{shiftKey:1}, chars:"\u00A7"},
"\u00A7", "Backquote", nsIDOMKeyEvent.DOM_VK_PIPE, "\u00A7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
// Brazilian ABNT
yield testKey({layout:KEYBOARD_LAYOUT_BRAZILIAN_ABNT, keyCode:WIN_VK_ABNT_C1,
modifiers:{}, chars:"/"},
- "/", "IntlRo" /* TODO, should be "IntlBackslash" */, nsIDOMKeyEvent.DOM_VK_SLASH, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
+ "/", "IntlBackslash", nsIDOMKeyEvent.DOM_VK_SLASH, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
yield testKey({layout:KEYBOARD_LAYOUT_BRAZILIAN_ABNT, keyCode:WIN_VK_ABNT_C1,
modifiers:{shiftKey:1}, chars:"?"},
- "?", "IntlRo" /* TODO, should be "IntlBackslash" */, nsIDOMKeyEvent.DOM_VK_SLASH, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
+ "?", "IntlBackslash", nsIDOMKeyEvent.DOM_VK_SLASH, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
yield testKey({layout:KEYBOARD_LAYOUT_BRAZILIAN_ABNT, keyCode:WIN_VK_ABNT_C2,
modifiers:{numLockKey:1}, chars:"."},
".", "NumpadComma", nsIDOMKeyEvent.DOM_VK_SEPARATOR, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
yield testKey({layout:KEYBOARD_LAYOUT_BRAZILIAN_ABNT, keyCode:WIN_VK_DECIMAL,
modifiers:{numLockKey:1}, chars:","},
",", "NumpadDecimal", nsIDOMKeyEvent.DOM_VK_DECIMAL, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
// Mac JIS keyboard