| Index: ui/events/keycodes/platform_key_map_win.cc
|
| diff --git a/ui/events/keycodes/platform_key_map_win.cc b/ui/events/keycodes/platform_key_map_win.cc
|
| index 439384c634941d9eb9017b047e3dd464860a9f9f..32b544e31ca8b72463fc8b75052ff91984cc3b5b 100644
|
| --- a/ui/events/keycodes/platform_key_map_win.cc
|
| +++ b/ui/events/keycodes/platform_key_map_win.cc
|
| @@ -286,6 +286,12 @@ PlatformKeyMap::~PlatformKeyMap() {}
|
|
|
| DomKey PlatformKeyMap::DomKeyFromKeyboardCodeImpl(KeyboardCode key_code,
|
| int flags) const {
|
| + // Windows expresses right-Alt as VKEY_MENU with the extended flag set.
|
| + // This key should generate AltGraph under layouts which use that modifier.
|
| + if (key_code == VKEY_MENU && (flags & EF_IS_EXTENDED_KEY) && has_alt_graph_) {
|
| + return DomKey::ALT_GRAPH;
|
| + }
|
| +
|
| DomKey key = NonPrintableKeyboardCodeToDomKey(key_code, keyboard_layout_);
|
| if (key != DomKey::NONE)
|
| return key;
|
| @@ -346,6 +352,7 @@ void PlatformKeyMap::UpdateLayout(HKL layout) {
|
| // TODO(chongz): Optimize layout switching (see crbug.com/587147).
|
| keyboard_layout_ = layout;
|
| printable_keycode_to_key_.clear();
|
| + has_alt_graph_ = false;
|
|
|
| // Map size for some sample keyboard layouts:
|
| // US: 476, French: 602, Persian: 482, Vietnamese: 1436
|
| @@ -385,6 +392,11 @@ void PlatformKeyMap::UpdateLayout(HKL layout) {
|
| printable_keycode_to_key_[std::make_pair(static_cast<int>(key_code),
|
| flags)] =
|
| DomKey::FromCharacter(translated_chars[0]);
|
| +
|
| + // Detect whether the layout makes use of AltGraph.
|
| + if (flags & EF_ALTGR_DOWN) {
|
| + has_alt_graph_ = true;
|
| + }
|
| } else {
|
| // Ignores legacy non-printable control characters.
|
| }
|
|
|