Index: ui/events/ozone/evdev/keyboard_evdev.cc |
diff --git a/ui/events/ozone/evdev/keyboard_evdev.cc b/ui/events/ozone/evdev/keyboard_evdev.cc |
index 1def4c66a8bef5977b6066af3636e5516bfbb436..dd0cc4f7bc4a0a0b4bf23482e624568234f288fb 100644 |
--- a/ui/events/ozone/evdev/keyboard_evdev.cc |
+++ b/ui/events/ozone/evdev/keyboard_evdev.cc |
@@ -35,6 +35,8 @@ int EventFlagToEvdevModifier(int flag) { |
return EVDEV_MODIFIER_ALT; |
case EF_ALTGR_DOWN: |
return EVDEV_MODIFIER_ALTGR; |
+ case EF_MOD3_DOWN: |
+ return EVDEV_MODIFIER_MOD3; |
case EF_LEFT_MOUSE_BUTTON: |
return EVDEV_MODIFIER_LEFT_MOUSE_BUTTON; |
case EF_MIDDLE_MOUSE_BUTTON: |
@@ -214,8 +216,15 @@ void KeyboardEvdev::DispatchKey(unsigned int key, |
&key_code, &platform_keycode)) { |
return; |
} |
- if (!repeat) |
- UpdateModifier(ModifierDomKeyToEventFlag(dom_key), down); |
+ if (!repeat) { |
+ int flag = ModifierDomKeyToEventFlag(dom_key); |
+ UpdateModifier(flag, down); |
+ // X11 XKB, using the configuration as modified for ChromeOS, always sets |
+ // EF_MOD3_DOWN for the physical CapsLock key, so we imitate this to make |
+ // certain layouts work. crbug.com/495277 |
+ if (static_cast<int>(dom_code) == 0x070039) |
kpschoedel
2015/06/08 20:11:32
Oops — forgot to do something about this before up
kpschoedel
2015/06/08 20:53:03
Done.
|
+ UpdateModifier(EF_MOD3_DOWN, down); |
+ } |
KeyEvent event(down ? ET_KEY_PRESSED : ET_KEY_RELEASED, key_code, dom_code, |
modifiers_->GetModifierFlags(), dom_key, character, timestamp); |
@@ -224,5 +233,4 @@ void KeyboardEvdev::DispatchKey(unsigned int key, |
event.set_platform_keycode(platform_keycode); |
callback_.Run(&event); |
} |
- |
} // namespace ui |