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

Unified Diff: mojo/examples/window_manager/window_manager.cc

Issue 404203003: Distinguish between keystroke and character events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: IsCharFromNative() for Mac build Created 6 years, 5 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: mojo/examples/window_manager/window_manager.cc
diff --git a/mojo/examples/window_manager/window_manager.cc b/mojo/examples/window_manager/window_manager.cc
index 1f4e597d472a123cbade3544d112f1ec9195f437..bbeb0a5d36acf09bc2f2aebd8661bba1906ab114 100644
--- a/mojo/examples/window_manager/window_manager.cc
+++ b/mojo/examples/window_manager/window_manager.cc
@@ -140,16 +140,24 @@ class KeyboardManager : public KeyboardClient,
#else
const bool is_char = false;
#endif
- view_manager_->DispatchEvent(
- view,
- Event::From(ui::KeyEvent(ui::ET_KEY_PRESSED,
- static_cast<ui::KeyboardCode>(code),
- flags, is_char)));
+ if (is_char) {
+ view_manager_->DispatchEvent(
+ view,
+ Event::From(ui::KeyEvent(ui::ET_KEY_PRESSED,
+ static_cast<ui::KeyboardCode>(code),
+ flags)));
+ } else {
+ view_manager_->DispatchEvent(
+ view,
+ Event::From(ui::KeyEvent(static_cast<base::char16>(code),
+ static_cast<ui::KeyboardCode>(code),
+ flags)));
+ }
view_manager_->DispatchEvent(
view,
Event::From(ui::KeyEvent(ui::ET_KEY_RELEASED,
static_cast<ui::KeyboardCode>(code),
- flags, false)));
+ flags)));
}
// Overridden from NodeObserver:
« no previous file with comments | « content/renderer/render_view_browsertest.cc ('k') | mojo/services/public/cpp/input_events/lib/input_events_type_converters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698