[chromedriver] Fixed US keyboard layout selection on Windows.
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:Shengfa Lin <shengfa@google.com> Cr-Commit-Position: refs/heads/master@{#825423}
Showing
Please register or sign in to comment