OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_KEYBOARD_LOCK_KEYBOARD_LOCK_TYPES_H_ |
| 6 #define COMPONENTS_KEYBOARD_LOCK_KEYBOARD_LOCK_TYPES_H_ |
| 7 |
| 8 #include <type_traits> |
| 9 #include <utility> |
| 10 |
| 11 #include "ui/events/keycodes/dom/keycode_converter.h" |
| 12 |
| 13 namespace keyboard_lock { |
| 14 |
| 15 // The type to represent a layout independent native keycode. |
| 16 // https://cs.chromium.org/chromium/src/ui/events/keycodes/dom/keycode_converter
.h?l=36&gs=cpp%253Aui%253A%253A%253Calias-of-KeycodeMapEntry%253E%253A%253Anativ
e_keycode%2540chromium%252F..%252F..%252Fui%252Fevents%252Fkeycodes%252Fdom%252F
keycode_converter.h%257Cdef&gsn=native_keycode&ct=xref_usages |
| 17 // Though it equals to integer, most of the components in the keyboard_lock |
| 18 // expects it to be in range [0, 256). Keyboard events out of this range will |
| 19 // usually be ignored. |
| 20 typedef decltype(std::declval<ui::KeycodeMapEntry>().native_keycode) |
| 21 NativeKeycode; |
| 22 |
| 23 static_assert(std::is_same<NativeKeycode, int>::value, |
| 24 "Expect native_keycode to be int"); |
| 25 |
| 26 } // namespace keyboard_lock |
| 27 |
| 28 #endif // COMPONENTS_KEYBOARD_LOCK_KEYBOARD_LOCK_TYPES_H_ |
OLD | NEW |