• chongz's avatar
    Original issue's description: · 3f4cf0ae
    chongz authored
    > [DomKey] Expose Korean special keys on Korean keyboard layout only
    >
    > Korean keyboard has special keys "HangulMode" and "HanjaMode", we should
    > only expose them when the system layout is Korean. Otherwise we should
    > return "Unidentified".
    >
    > This matches Firefox and windows virtual key.
    >
    > Note: This also works with JIS keyboard + Korean layout, because we are
    > mapping DomKey based on KeyboardCode instead of DomCode.
    >
    > BUG=612736
    >
    > Committed: https://crrev.com/bdcfb5a1816f1bad537d7611c7ccb972b550339c
    > Cr-Commit-Position: refs/heads/master@{#399783}
    > Revert: https://codereview.chromium.org/2061123005
    
    Original issue:
    Windows API |LoadKeyboardLayout()| won't pass DrMemory
    tests for Korean and Japanese locale.
    This should be an issue of DrMemory test or Windows itself.
    See https://crbug.com/612736#c11
    
    Solution:
    Just skip |LoadKeyboardLayout()| and hardcode locale for Korean,
    it works because we are only testing non-printable keys, which
    doesn't care about |ToUnicodeEx()|.
    
    Note:
    |ToUnicodeEx()| returns empty string if the specified locale is invalid. (e.g. Korean HKL without calling 'LoadKeyboardLayout()')
    
    Also Note:
    "mock_keyboard.h" has the similar issue, e.g.
    Call "MockKeyboard::GetCharacters(MockKeyboard::LAYOUT_KOREAN, ..)" somewhere and run DrMemory full test, which will fail as well.
    
    BUG=612736
    
    Review-Url: https://codereview.chromium.org/2097643002
    Cr-Commit-Position: refs/heads/master@{#402611}
    3f4cf0ae
platform_key_map_win.cc 12.7 KB