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

Unified Diff: ui/aura/remote_root_window_host_win.cc

Issue 11194044: Add keyboard events to metro aura (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 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/remote_root_window_host_win.cc
===================================================================
--- ui/aura/remote_root_window_host_win.cc (revision 162199)
+++ ui/aura/remote_root_window_host_win.cc (working copy)
@@ -14,6 +14,7 @@
#include "ui/aura/root_window.h"
#include "ui/base/cursor/cursor_loader_win.h"
#include "ui/base/events/event.h"
+#include "ui/base/keycodes/keyboard_code_conversion_win.h"
#include "ui/base/view_prop.h"
using std::max;
@@ -136,13 +137,13 @@
NOTIMPLEMENTED();
}
-void RemoteRootWindowHostWin::OnMouseMoved(int x, int y, int extra) {
+void RemoteRootWindowHostWin::OnMouseMoved(int32 x, int32 y, int32 extra) {
gfx::Point location(x, y);
ui::MouseEvent event(ui::ET_MOUSE_MOVED, location, location, 0);
delegate_->OnHostMouseEvent(&event);
}
-void RemoteRootWindowHostWin::OnMouseClick(int x, int y, int extra) {
+void RemoteRootWindowHostWin::OnMouseClick(int32 x, int32 y, int32 extra) {
gfx::Point location(x, y);
ui::EventType type = (extra == 1) ?
ui::ET_MOUSE_PRESSED : ui::ET_MOUSE_RELEASED;
@@ -152,4 +153,22 @@
delegate_->OnHostMouseEvent(&event);
}
+void RemoteRootWindowHostWin::OnKeyDown(uint32 vkey,
+ uint32 repeat_count,
+ uint32 scan_code) {
+ ui::KeyEvent event(ui::ET_KEY_PRESSED,
+ ui::KeyboardCodeForWindowsKeyCode(vkey),
+ 0);
+ delegate_->OnHostKeyEvent(&event);
+}
+
+void RemoteRootWindowHostWin::OnKeyUp(uint32 vkey,
+ uint32 repeat_count,
+ uint32 scan_code) {
+ ui::KeyEvent event(ui::ET_KEY_RELEASED,
+ ui::KeyboardCodeForWindowsKeyCode(vkey),
+ 0);
+ delegate_->OnHostKeyEvent(&event);
+}
+
} // namespace aura

Powered by Google App Engine
This is Rietveld 408576698