| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/native_device_keymap.h" | 5 #include "remoting/client/input/native_device_keymap.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace { | 9 namespace { |
| 10 | 10 |
| 11 // These must be defined in the same order as the Android keycodes in | 11 // These must be defined in the same order as the Android keycodes in |
| 12 // <android/keycodes.h> and | 12 // <android/keycodes.h> and |
| 13 // "ui/events/keycodes/keyboard_code_conversion_android.cc" . Some of these | 13 // "ui/events/keycodes/keyboard_code_conversion_android.cc" . Some of these |
| 14 // mappings assume a US keyboard layout for now. | 14 // mappings assume a US keyboard layout for now. |
| 15 const uint32_t usb_keycodes[] = { | 15 const uint32_t usb_keycodes[] = { |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 uint32_t NativeDeviceKeycodeToUsbKeycode(size_t device_keycode) { | 206 uint32_t NativeDeviceKeycodeToUsbKeycode(size_t device_keycode) { |
| 207 if (device_keycode >= sizeof(usb_keycodes) / sizeof(uint32_t)) { | 207 if (device_keycode >= sizeof(usb_keycodes) / sizeof(uint32_t)) { |
| 208 LOG(WARNING) << "Attempted to decode out-of-range Android keycode"; | 208 LOG(WARNING) << "Attempted to decode out-of-range Android keycode"; |
| 209 return 0; | 209 return 0; |
| 210 } | 210 } |
| 211 | 211 |
| 212 return usb_keycodes[device_keycode]; | 212 return usb_keycodes[device_keycode]; |
| 213 } | 213 } |
| 214 | 214 |
| 215 } // namespace remoting | 215 } // namespace remoting |
| OLD | NEW |