OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/normalizing_input_filter_cros.h" | 5 #include "remoting/client/normalizing_input_filter_cros.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ui/events/keycodes/dom/dom_code.h" | 8 #include "ui/events/keycodes/dom/dom_code.h" |
9 | 9 |
10 namespace remoting { | 10 namespace remoting { |
11 | 11 |
12 namespace { | 12 namespace { |
13 | 13 |
14 // Returns true for OSKey codes. | 14 // Returns true for OSKey codes. |
15 static bool IsOsKey(uint32_t code) { | 15 static bool IsOsKey(uint32_t code) { |
16 return code == static_cast<uint32_t>(ui::DomCode::OS_LEFT) || | 16 return code == static_cast<uint32_t>(ui::DomCode::META_LEFT) || |
17 code == static_cast<uint32_t>(ui::DomCode::OS_RIGHT); | 17 code == static_cast<uint32_t>(ui::DomCode::META_RIGHT); |
18 } | 18 } |
19 | 19 |
20 // Returns true for codes generated by EventRewriter::RewriteFunctionKeys(). | 20 // Returns true for codes generated by EventRewriter::RewriteFunctionKeys(). |
21 static bool IsRewrittenFunctionKey(uint32_t code) { | 21 static bool IsRewrittenFunctionKey(uint32_t code) { |
22 return code >= static_cast<uint32_t>(ui::DomCode::F1) && | 22 return code >= static_cast<uint32_t>(ui::DomCode::F1) && |
23 code <= static_cast<uint32_t>(ui::DomCode::F12); | 23 code <= static_cast<uint32_t>(ui::DomCode::F12); |
24 } | 24 } |
25 | 25 |
26 // Returns true for codes generated by EventRewriter::RewriteExtendedKeys(). | 26 // Returns true for codes generated by EventRewriter::RewriteExtendedKeys(). |
27 static bool IsRewrittenExtendedKey(uint32_t code) { | 27 static bool IsRewrittenExtendedKey(uint32_t code) { |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 case static_cast<uint32_t>(ui::DomCode::PAGE_UP): | 236 case static_cast<uint32_t>(ui::DomCode::PAGE_UP): |
237 event->set_usb_keycode(static_cast<uint32_t>(ui::DomCode::ARROW_UP)); | 237 event->set_usb_keycode(static_cast<uint32_t>(ui::DomCode::ARROW_UP)); |
238 break; | 238 break; |
239 case static_cast<uint32_t>(ui::DomCode::DEL): | 239 case static_cast<uint32_t>(ui::DomCode::DEL): |
240 event->set_usb_keycode(static_cast<uint32_t>(ui::DomCode::BACKSPACE)); | 240 event->set_usb_keycode(static_cast<uint32_t>(ui::DomCode::BACKSPACE)); |
241 break; | 241 break; |
242 } | 242 } |
243 } | 243 } |
244 | 244 |
245 } // namespace remoting | 245 } // namespace remoting |
OLD | NEW |