OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_OZONE_LAYOUT_XKB_XKB_KEYBOARD_LAYOUT_ENGINE_H_ | 5 #ifndef UI_EVENTS_OZONE_LAYOUT_XKB_XKB_KEYBOARD_LAYOUT_ENGINE_H_ |
6 #define UI_EVENTS_OZONE_LAYOUT_XKB_XKB_KEYBOARD_LAYOUT_ENGINE_H_ | 6 #define UI_EVENTS_OZONE_LAYOUT_XKB_XKB_KEYBOARD_LAYOUT_ENGINE_H_ |
7 | 7 |
8 #include <xkbcommon/xkbcommon.h> | 8 #include <xkbcommon/xkbcommon.h> |
9 | 9 |
10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
(...skipping 27 matching lines...) Expand all Loading... |
38 uint32* platform_keycode) const override; | 38 uint32* platform_keycode) const override; |
39 | 39 |
40 protected: | 40 protected: |
41 // Table for EventFlagsToXkbFlags(). | 41 // Table for EventFlagsToXkbFlags(). |
42 struct XkbFlagMapEntry { | 42 struct XkbFlagMapEntry { |
43 int ui_flag; | 43 int ui_flag; |
44 xkb_mod_mask_t xkb_flag; | 44 xkb_mod_mask_t xkb_flag; |
45 }; | 45 }; |
46 std::vector<XkbFlagMapEntry> xkb_flag_map_; | 46 std::vector<XkbFlagMapEntry> xkb_flag_map_; |
47 | 47 |
| 48 // Flag mask for num lock, which is always considered enabled. |
| 49 xkb_mod_mask_t num_lock_mod_mask_; |
| 50 |
48 // Determines the Windows-based KeyboardCode (VKEY) for a character key, | 51 // Determines the Windows-based KeyboardCode (VKEY) for a character key, |
49 // accounting for non-US layouts. May return VKEY_UNKNOWN, in which case the | 52 // accounting for non-US layouts. May return VKEY_UNKNOWN, in which case the |
50 // caller should use |DomCodeToNonLocatedKeyboardCode()| as a last resort. | 53 // caller should use |DomCodeToNonLocatedKeyboardCode()| as a last resort. |
51 KeyboardCode DifficultKeyboardCode(DomCode dom_code, | 54 KeyboardCode DifficultKeyboardCode(DomCode dom_code, |
52 int ui_flags, | 55 int ui_flags, |
53 xkb_keycode_t xkb_keycode, | 56 xkb_keycode_t xkb_keycode, |
54 xkb_mod_mask_t xkb_flags, | 57 xkb_mod_mask_t xkb_flags, |
55 xkb_keysym_t xkb_keysym, | 58 xkb_keysym_t xkb_keysym, |
56 DomKey dom_key, | 59 DomKey dom_key, |
57 base::char16 character) const; | 60 base::char16 character) const; |
(...skipping 26 matching lines...) Expand all Loading... |
84 | 87 |
85 // libxkbcommon uses explicit reference counting for its structures, | 88 // libxkbcommon uses explicit reference counting for its structures, |
86 // so we need to trigger its cleanup. | 89 // so we need to trigger its cleanup. |
87 scoped_ptr<xkb_context, XkbContextDeleter> xkb_context_; | 90 scoped_ptr<xkb_context, XkbContextDeleter> xkb_context_; |
88 scoped_ptr<xkb_state, XkbStateDeleter> xkb_state_; | 91 scoped_ptr<xkb_state, XkbStateDeleter> xkb_state_; |
89 }; | 92 }; |
90 | 93 |
91 } // namespace ui | 94 } // namespace ui |
92 | 95 |
93 #endif // UI_EVENTS_OZONE_LAYOUT_XKB_XKB_KEYBOARD_LAYOUT_ENGINE_H_ | 96 #endif // UI_EVENTS_OZONE_LAYOUT_XKB_XKB_KEYBOARD_LAYOUT_ENGINE_H_ |
OLD | NEW |