Commit 6465ea09 authored by Wez's avatar Wez Committed by Commit Bot

[events] Remove IntlHash definition and Backslash workaround.

IntlHash is no longer a valid DOM |code| value, so remove it from the
DomCode tables, along with the associated KeycodeConverter work-around
for it having a native keycode indistinguishable from US Backslash on
all platforms, except at the actual USB Usage level.

Bug: 952051
Change-Id: I0774105ab845ce5cbda475e9ae19f792745eca0b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2020708
Commit-Queue: Wez <wez@chromium.org>
Reviewed-by: default avatarDave Tapuska <dtapuska@chromium.org>
Auto-Submit: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/master@{#735927}
parent e4a96066
......@@ -201,7 +201,7 @@ DOM_CODE_DECLARATION {
// The keycap varies on international keyboards:
// Dan: '* Dutch: <> Ger: #' UK: #~
// TODO(garykac): Verify Mac intl keyboard.
DOM_CODE(0x070032, 0x0000, 0x0000, 0x0000, 0xffff, "IntlHash", INTL_HASH),
//DOM_CODE(0x070032, 0x0000, 0x0000, 0x0000, 0xffff, NULL, INTL_HASH),
DOM_CODE(0x070033, 0x0027, 0x002f, 0x0027, 0x0029, "Semicolon", SEMICOLON), // ;:
DOM_CODE(0x070034, 0x0028, 0x0030, 0x0028, 0x0027, "Quote", QUOTE), // '"
DOM_CODE(0x070035, 0x0029, 0x0031, 0x0029, 0x0032, "Backquote", BACKQUOTE), // `~
......
......@@ -258,8 +258,6 @@ uint32_t KeycodeConverter::InvalidUsbKeycode() {
// static
int KeycodeConverter::UsbKeycodeToNativeKeycode(uint32_t usb_keycode) {
// Deal with some special-cases that don't fit the 1:1 mapping.
if (usb_keycode == 0x070032) // non-US hash.
usb_keycode = 0x070031; // US backslash.
#if defined(OS_MACOSX)
if (usb_keycode == 0x070046) // PrintScreen.
usb_keycode = 0x070068; // F13.
......
......@@ -50,8 +50,6 @@ struct KeycodeConverterData {
#undef DOM_CODE_DECLARATION
const uint32_t kUsbNonExistentKeycode = 0xffffff;
const uint32_t kUsbUsBackslash = 0x070031;
const uint32_t kUsbNonUsHash = 0x070032;
TEST(UsbKeycodeMap, KeycodeConverterData) {
// This test looks at all kinds of supported native codes.
......@@ -149,13 +147,6 @@ TEST(UsbKeycodeMap, NonExistent) {
ui::KeycodeConverter::UsbKeycodeToNativeKeycode(kUsbNonExistentKeycode));
}
TEST(UsbKeycodeMap, UsBackslashIsNonUsHash) {
// Verify that UsbKeycodeToNativeKeycode treats the non-US "hash" key
// as equivalent to the US "backslash" key.
EXPECT_EQ(ui::KeycodeConverter::UsbKeycodeToNativeKeycode(kUsbUsBackslash),
ui::KeycodeConverter::UsbKeycodeToNativeKeycode(kUsbNonUsHash));
}
TEST(KeycodeConverter, DomCode) {
// Test invalid and unknown arguments to CodeStringToDomCode()
EXPECT_EQ(ui::DomCode::NONE, ui::KeycodeConverter::CodeStringToDomCode("-"));
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment