| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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 #ifndef UI_EVENTS_KEYCODES_PLATFORM_KEY_MAP_WIN_H_ | 5 #ifndef UI_EVENTS_KEYCODES_PLATFORM_KEY_MAP_WIN_H_ |
| 6 #define UI_EVENTS_KEYCODES_PLATFORM_KEY_MAP_WIN_H_ | 6 #define UI_EVENTS_KEYCODES_PLATFORM_KEY_MAP_WIN_H_ |
| 7 | 7 |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 | 9 |
| 10 #include <unordered_map> | 10 #include <unordered_map> |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 // TODO(chongz): Expose this function when we need to access separate layout. | 37 // TODO(chongz): Expose this function when we need to access separate layout. |
| 38 // Returns the DomKey 'meaning' of |KeyboardCode| in the context of specified | 38 // Returns the DomKey 'meaning' of |KeyboardCode| in the context of specified |
| 39 // |EventFlags| and stored keyboard layout. | 39 // |EventFlags| and stored keyboard layout. |
| 40 DomKey DomKeyFromKeyboardCodeImpl(KeyboardCode, int flags) const; | 40 DomKey DomKeyFromKeyboardCodeImpl(KeyboardCode, int flags) const; |
| 41 | 41 |
| 42 // TODO(chongz): Expose this function in response to WM_INPUTLANGCHANGE. | 42 // TODO(chongz): Expose this function in response to WM_INPUTLANGCHANGE. |
| 43 void UpdateLayout(HKL layout); | 43 void UpdateLayout(HKL layout); |
| 44 | 44 |
| 45 HKL keyboard_layout_ = 0; | 45 HKL keyboard_layout_ = 0; |
| 46 | 46 |
| 47 // True if |keyboard_layout_| makes use of the AltGraph modifier. |
| 48 bool has_alt_graph_ = false; |
| 49 |
| 47 typedef std::pair<int /*KeyboardCode*/, int /*EventFlags*/> | 50 typedef std::pair<int /*KeyboardCode*/, int /*EventFlags*/> |
| 48 KeyboardCodeEventFlagsPair; | 51 KeyboardCodeEventFlagsPair; |
| 49 typedef std::unordered_map<KeyboardCodeEventFlagsPair, | 52 typedef std::unordered_map<KeyboardCodeEventFlagsPair, |
| 50 DomKey, | 53 DomKey, |
| 51 base::IntPairHash<std::pair<int, int>>> | 54 base::IntPairHash<std::pair<int, int>>> |
| 52 KeyboardCodeToKeyMap; | 55 KeyboardCodeToKeyMap; |
| 53 KeyboardCodeToKeyMap printable_keycode_to_key_; | 56 KeyboardCodeToKeyMap printable_keycode_to_key_; |
| 54 | 57 |
| 55 DISALLOW_COPY_AND_ASSIGN(PlatformKeyMap); | 58 DISALLOW_COPY_AND_ASSIGN(PlatformKeyMap); |
| 56 }; | 59 }; |
| 57 | 60 |
| 58 } // namespace ui | 61 } // namespace ui |
| 59 | 62 |
| 60 #endif // UI_EVENTS_KEYCODES_PLATFORM_KEY_MAP_WIN_H_ | 63 #endif // UI_EVENTS_KEYCODES_PLATFORM_KEY_MAP_WIN_H_ |
| OLD | NEW |