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

Unified Diff: ui/aura/window_tree_host_x11.cc

Issue 336403005: Use XInput2 events for keyboard events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments (derat), the sequel. Created 6 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
Index: ui/aura/window_tree_host_x11.cc
diff --git a/ui/aura/window_tree_host_x11.cc b/ui/aura/window_tree_host_x11.cc
index f2604eb7999dcd31ec3306690011cc2edd237280..9778413427a6cf175415cfc6abf39ca2ae57b36d 100644
--- a/ui/aura/window_tree_host_x11.cc
+++ b/ui/aura/window_tree_host_x11.cc
@@ -372,14 +372,15 @@ uint32_t WindowTreeHostX11::DispatchEvent(const ui::PlatformEvent& event) {
compositor()->ScheduleRedrawRect(damage_rect);
break;
}
- case KeyPress: {
- ui::KeyEvent keydown_event(xev, false);
- SendEventToProcessor(&keydown_event);
- break;
- }
+ case KeyPress:
case KeyRelease: {
- ui::KeyEvent keyup_event(xev, false);
- SendEventToProcessor(&keyup_event);
+#if defined(OS_CHROMEOS)
+ // Chrome OS uses XI2 key events instead.
+ if (base::SysInfo::IsRunningOnChromeOS())
sadrul 2014/06/26 12:34:20 We should avoid using this, because it makes it ve
kpschoedel 2014/06/26 17:24:10 I don't follow how that helps. We still have to ch
sadrul 2014/06/26 17:28:07 We don't have to make such decisions for mouse eve
kpschoedel 2014/06/26 19:10:58 OK... I see that no core ButtonPress events arrive
kpschoedel 2014/06/26 21:50:40 Never mind, got it now.
+ break;
+#endif
+ ui::KeyEvent key_event(xev, false);
+ SendEventToProcessor(&key_event);
break;
}
case ButtonPress:
@@ -699,6 +700,16 @@ void WindowTreeHostX11::DispatchXI2Event(const base::NativeEvent& event) {
SendEventToProcessor(&scrollev);
break;
}
+ case ui::ET_KEY_PRESSED:
+ case ui::ET_KEY_RELEASED: {
+#if defined(OS_CHROMEOS)
+ if (base::SysInfo::IsRunningOnChromeOS()) {
+ ui::KeyEvent key_event(xev, false);
+ SendEventToProcessor(&key_event);
+ }
+#endif
+ break;
+ }
case ui::ET_UMA_DATA:
break;
case ui::ET_UNKNOWN:

Powered by Google App Engine
This is Rietveld 408576698