• Peter Kvitek's avatar
    [chromedriver] Fixed US keyboard layout selection on Windows. · c76d5aef
    Peter Kvitek authored
    The previous code used to activate all existing keyboard layouts one
    by one, then retrieve activated keyboard layout name and compare it
    to US keyboard layout identifier.  The comparison failed since on
    modern Windows keyboard layout name includes keyboard device identifier
    (like Dvorak keyboard, etc) in the high word and this caused the last
    checked keyboard layout to be left active. That layout is rarely
    a US layout, which caused character to virtual key conversion API
    ::VkKeyScan() to fail on ASCII character keys.
    
    The new code uses LoadKeyboardLayout() API that loads and activates
    the specified keyboard layout (US English) or leaves system default
    language of the system, if US English layout does not exist.
    
    Bug: 783703
    Change-Id: I2cdc1d4984131e455d30a16dbbd9c66c209e686e
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2521836
    Commit-Queue: Shengfa Lin <shengfa@google.com>
    Reviewed-by: default avatarShengfa Lin <shengfa@google.com>
    Cr-Commit-Position: refs/heads/master@{#825423}
    c76d5aef
keycode_text_conversion_win.cc 2.85 KB