Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(453)

Unified Diff: ui/events/ozone/evdev/keyboard_evdev.cc

Issue 1165223003: Fix Ozone keyboard layout to handle German Neo 2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@x489769-rewriter
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/keycodes/keyboard_code_conversion_xkb.cc ('k') | ui/events/ozone/layout/layout_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ui/events/keycodes/keyboard_code_conversion_xkb.cc ('k') | ui/events/ozone/layout/layout_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698