| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "remoting/host/event_executor_win.h" | 5 #include "remoting/host/event_executor_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/stl_util-inl.h" | 10 #include "base/stl_util-inl.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 } | 73 } |
| 74 | 74 |
| 75 // Flag to mark keyup events. Default is keydown. | 75 // Flag to mark keyup events. Default is keydown. |
| 76 if (!down) { | 76 if (!down) { |
| 77 input.ki.dwFlags |= KEYEVENTF_KEYUP; | 77 input.ki.dwFlags |= KEYEVENTF_KEYUP; |
| 78 } | 78 } |
| 79 | 79 |
| 80 SendInput(1, &input, sizeof(INPUT)); | 80 SendInput(1, &input, sizeof(INPUT)); |
| 81 } | 81 } |
| 82 | 82 |
| 83 protocol::InputStub* CreateEventExecutor(MessageLoop* message_loop, | 83 protocol::InputStub* CreateEventExecutor(MessageLoopForUI* message_loop, |
| 84 Capturer* capturer) { | 84 Capturer* capturer) { |
| 85 return new EventExecutorWin(message_loop, capturer); | 85 return new EventExecutorWin(message_loop, capturer); |
| 86 } | 86 } |
| 87 | 87 |
| 88 void EventExecutorWin::HandleMouse(const MouseEvent* event) { | 88 void EventExecutorWin::HandleMouse(const MouseEvent* event) { |
| 89 // TODO(garykac) Collapse mouse (x,y) and button events into a single | 89 // TODO(garykac) Collapse mouse (x,y) and button events into a single |
| 90 // input event when possible. | 90 // input event when possible. |
| 91 if (event->has_x() && event->has_y()) { | 91 if (event->has_x() && event->has_y()) { |
| 92 int x = event->x(); | 92 int x = event->x(); |
| 93 int y = event->y(); | 93 int y = event->y(); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 } else { | 142 } else { |
| 143 button_event.mi.dwFlags = | 143 button_event.mi.dwFlags = |
| 144 down ? MOUSEEVENTF_LEFTDOWN : MOUSEEVENTF_LEFTUP; | 144 down ? MOUSEEVENTF_LEFTDOWN : MOUSEEVENTF_LEFTUP; |
| 145 } | 145 } |
| 146 | 146 |
| 147 SendInput(1, &button_event, sizeof(INPUT)); | 147 SendInput(1, &button_event, sizeof(INPUT)); |
| 148 } | 148 } |
| 149 } | 149 } |
| 150 | 150 |
| 151 } // namespace remoting | 151 } // namespace remoting |
| OLD | NEW |