Hidehiko Abe | 23f5e81 | 2020-09-20 02:57:19 | [diff] [blame] | 1 | // Copyright 2020 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_EXO_KEYBOARD_MODIFIERS_H_ |
| 6 | #define COMPONENTS_EXO_KEYBOARD_MODIFIERS_H_ |
| 7 | |
| 8 | #include <stdint.h> |
| 9 | |
Hidehiko Abe | 2285197 | 2020-09-23 23:49:50 | [diff] [blame] | 10 | #include <tuple> |
| 11 | |
Hidehiko Abe | 23f5e81 | 2020-09-20 02:57:19 | [diff] [blame] | 12 | namespace exo { |
| 13 | |
| 14 | // Represents keyboard modifiers. |
| 15 | struct KeyboardModifiers { |
| 16 | uint32_t depressed; |
| 17 | uint32_t locked; |
| 18 | uint32_t latched; |
| 19 | uint32_t group; |
| 20 | }; |
| 21 | |
Hidehiko Abe | 2285197 | 2020-09-23 23:49:50 | [diff] [blame] | 22 | inline bool operator==(const KeyboardModifiers& lhs, |
| 23 | const KeyboardModifiers& rhs) { |
| 24 | return std::tie(lhs.depressed, lhs.locked, lhs.latched, lhs.group) == |
| 25 | std::tie(rhs.depressed, rhs.locked, rhs.latched, rhs.group); |
| 26 | } |
| 27 | |
Hidehiko Abe | 23f5e81 | 2020-09-20 02:57:19 | [diff] [blame] | 28 | } // namespace exo |
| 29 | |
| 30 | #endif // COMPONENTS_EXO_KEYBOARD_MODIFIERS_H_ |