| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/client/input_handler.h" | 5 #include "remoting/client/input_handler.h" |
| 6 | 6 |
| 7 #include "remoting/client/chromoting_view.h" | 7 #include "remoting/client/chromoting_view.h" |
| 8 #include "remoting/proto/event.pb.h" | 8 #include "remoting/proto/event.pb.h" |
| 9 #include "remoting/protocol/connection_to_host.h" | 9 #include "remoting/protocol/connection_to_host.h" |
| 10 #include "remoting/protocol/input_stub.h" | 10 #include "remoting/protocol/input_stub.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 MouseEvent::MouseButton button) { | 55 MouseEvent::MouseButton button) { |
| 56 protocol::InputStub* stub = connection_->input_stub(); | 56 protocol::InputStub* stub = connection_->input_stub(); |
| 57 if (stub) { | 57 if (stub) { |
| 58 MouseEvent event; | 58 MouseEvent event; |
| 59 event.set_button(button); | 59 event.set_button(button); |
| 60 event.set_button_down(button_down); | 60 event.set_button_down(button_down); |
| 61 stub->InjectMouseEvent(event); | 61 stub->InjectMouseEvent(event); |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 | 64 |
| 65 void InputHandler::SendMouseWheelEvent(int dx, int dy) { |
| 66 protocol::InputStub* stub = connection_->input_stub(); |
| 67 if (stub) { |
| 68 MouseEvent event; |
| 69 event.set_wheel_offset_x(dx); |
| 70 event.set_wheel_offset_y(dy); |
| 71 stub->InjectMouseEvent(event); |
| 72 } |
| 73 } |
| 74 |
| 65 void InputHandler::ReleaseAllKeys() { | 75 void InputHandler::ReleaseAllKeys() { |
| 66 std::set<int> pressed_keys_copy = pressed_keys_; | 76 std::set<int> pressed_keys_copy = pressed_keys_; |
| 67 std::set<int>::iterator i; | 77 std::set<int>::iterator i; |
| 68 for (i = pressed_keys_copy.begin(); i != pressed_keys_copy.end(); ++i) { | 78 for (i = pressed_keys_copy.begin(); i != pressed_keys_copy.end(); ++i) { |
| 69 SendKeyEvent(false, *i); | 79 SendKeyEvent(false, *i); |
| 70 } | 80 } |
| 71 pressed_keys_.clear(); | 81 pressed_keys_.clear(); |
| 72 } | 82 } |
| 73 | 83 |
| 74 } // namespace remoting | 84 } // namespace remoting |
| OLD | NEW |