diff options
author | cpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-18 20:44:16 +0000 |
---|---|---|
committer | cpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-18 20:44:16 +0000 |
commit | 9ed88aedad5c7f9865f783f18de257d5e1185612 (patch) | |
tree | 8d527f35600324030076fbe58f8735ae27df4362 /ui/aura | |
parent | 33204e20863bca9a9857c338400777be6176537a (diff) | |
download | chromium_src-9ed88aedad5c7f9865f783f18de257d5e1185612.zip chromium_src-9ed88aedad5c7f9865f783f18de257d5e1185612.tar.gz chromium_src-9ed88aedad5c7f9865f783f18de257d5e1185612.tar.bz2 |
Add keyboard events to metro aura
This is the first part since there IME are issues
that need to be sorted out before this can fully
work. In particular, InputMethodEventFilter::PreHandleKeyEvent
needs changes not to assume native events.
BUG=151718
TEST=none
Review URL: https://codereview.chromium.org/11194044
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162781 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura')
-rw-r--r-- | ui/aura/remote_root_window_host_win.cc | 23 | ||||
-rw-r--r-- | ui/aura/remote_root_window_host_win.h | 6 |
2 files changed, 25 insertions, 4 deletions
diff --git a/ui/aura/remote_root_window_host_win.cc b/ui/aura/remote_root_window_host_win.cc index 619b783..71411b0 100644 --- a/ui/aura/remote_root_window_host_win.cc +++ b/ui/aura/remote_root_window_host_win.cc @@ -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 @@ void RemoteRootWindowHostWin::PrepareForShutdown() { 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 @@ void RemoteRootWindowHostWin::OnMouseClick(int x, int y, int extra) { 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 diff --git a/ui/aura/remote_root_window_host_win.h b/ui/aura/remote_root_window_host_win.h index 795af0f..c45af18 100644 --- a/ui/aura/remote_root_window_host_win.h +++ b/ui/aura/remote_root_window_host_win.h @@ -22,8 +22,10 @@ class AURA_EXPORT RemoteRootWindowHostWin : public RootWindowHost { static RemoteRootWindowHostWin* Instance(); static RemoteRootWindowHostWin* Create(const gfx::Rect& bounds); - void OnMouseMoved(int x, int y, int extra); - void OnMouseClick(int x, int y, int extra); + void OnMouseMoved(int32 x, int32 y, int32 extra); + void OnMouseClick(int32 x, int32 y, int32 extra); + void OnKeyDown(uint32 vkey, uint32 repeat_count, uint32 scan_code); + void OnKeyUp(uint32 vkey, uint32 repeat_count, uint32 scan_code); private: RemoteRootWindowHostWin(const gfx::Rect& bounds); |