OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/protocol/input_event_tracker.h" | 5 #include "remoting/protocol/input_event_tracker.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "remoting/proto/event.pb.h" | 8 #include "remoting/proto/event.pb.h" |
9 | 9 |
10 namespace remoting { | 10 namespace remoting { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 bool ctrl_expected, | 74 bool ctrl_expected, |
75 bool os_expected, | 75 bool os_expected, |
76 bool shift_expected) { | 76 bool shift_expected) { |
77 bool alt_down = | 77 bool alt_down = |
78 pressed_keys_.find(ui::DomCode::ALT_LEFT) != pressed_keys_.end() || | 78 pressed_keys_.find(ui::DomCode::ALT_LEFT) != pressed_keys_.end() || |
79 pressed_keys_.find(ui::DomCode::ALT_RIGHT) != pressed_keys_.end(); | 79 pressed_keys_.find(ui::DomCode::ALT_RIGHT) != pressed_keys_.end(); |
80 bool ctrl_down = | 80 bool ctrl_down = |
81 pressed_keys_.find(ui::DomCode::CONTROL_LEFT) != pressed_keys_.end() || | 81 pressed_keys_.find(ui::DomCode::CONTROL_LEFT) != pressed_keys_.end() || |
82 pressed_keys_.find(ui::DomCode::CONTROL_RIGHT) != pressed_keys_.end(); | 82 pressed_keys_.find(ui::DomCode::CONTROL_RIGHT) != pressed_keys_.end(); |
83 bool os_down = | 83 bool os_down = |
84 pressed_keys_.find(ui::DomCode::OS_LEFT) != pressed_keys_.end() || | 84 pressed_keys_.find(ui::DomCode::META_LEFT) != pressed_keys_.end() || |
85 pressed_keys_.find(ui::DomCode::OS_RIGHT) != pressed_keys_.end(); | 85 pressed_keys_.find(ui::DomCode::META_RIGHT) != pressed_keys_.end(); |
86 bool shift_down = | 86 bool shift_down = |
87 pressed_keys_.find(ui::DomCode::SHIFT_LEFT) != pressed_keys_.end() || | 87 pressed_keys_.find(ui::DomCode::SHIFT_LEFT) != pressed_keys_.end() || |
88 pressed_keys_.find(ui::DomCode::SHIFT_RIGHT) != pressed_keys_.end(); | 88 pressed_keys_.find(ui::DomCode::SHIFT_RIGHT) != pressed_keys_.end(); |
89 | 89 |
90 if ((alt_down && !alt_expected) || (ctrl_down && !ctrl_expected) || | 90 if ((alt_down && !alt_expected) || (ctrl_down && !ctrl_expected) || |
91 (os_down && !os_expected) || (shift_down && !shift_expected)) { | 91 (os_down && !os_expected) || (shift_down && !shift_expected)) { |
92 ReleaseAll(); | 92 ReleaseAll(); |
93 } | 93 } |
94 } | 94 } |
95 | 95 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 } | 159 } |
160 break; | 160 break; |
161 default: | 161 default: |
162 break; | 162 break; |
163 } | 163 } |
164 input_stub_->InjectTouchEvent(event); | 164 input_stub_->InjectTouchEvent(event); |
165 } | 165 } |
166 | 166 |
167 } // namespace protocol | 167 } // namespace protocol |
168 } // namespace remoting | 168 } // namespace remoting |
OLD | NEW |