OLD | NEW |
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium OS 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 CHROMEOS_KEYBOARD_H_ | 5 #ifndef CHROMEOS_KEYBOARD_H_ |
6 #define CHROMEOS_KEYBOARD_H_ | 6 #define CHROMEOS_KEYBOARD_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 21 matching lines...) Expand all Loading... |
32 : original(in_original), replacement(in_replacement) {} | 32 : original(in_original), replacement(in_replacement) {} |
33 bool operator==(const ModifierKeyPair& rhs) const { | 33 bool operator==(const ModifierKeyPair& rhs) const { |
34 // For CheckMap() in chromeos_keyboard_unittest.cc. | 34 // For CheckMap() in chromeos_keyboard_unittest.cc. |
35 return (rhs.original == original) && (rhs.replacement == replacement); | 35 return (rhs.original == original) && (rhs.replacement == replacement); |
36 } | 36 } |
37 ModifierKey original; // Replace the key with | 37 ModifierKey original; // Replace the key with |
38 ModifierKey replacement; // this key. | 38 ModifierKey replacement; // this key. |
39 }; | 39 }; |
40 typedef std::vector<ModifierKeyPair> ModifierMap; | 40 typedef std::vector<ModifierKeyPair> ModifierMap; |
41 | 41 |
| 42 // Returns the hardware layout name. |
| 43 extern std::string (*GetHardwareKeyboardLayoutName)(); |
| 44 |
42 // Returns the current layout name like "us". On error, returns "". | 45 // Returns the current layout name like "us". On error, returns "". |
43 extern std::string (*GetCurrentKeyboardLayoutName)(); | 46 extern std::string (*GetCurrentKeyboardLayoutName)(); |
44 | 47 |
45 // Sets the current keyboard layout to |layout_name|. This function does not | 48 // Sets the current keyboard layout to |layout_name|. This function does not |
46 // change the current mapping of the modifier keys. Returns true on success. | 49 // change the current mapping of the modifier keys. Returns true on success. |
47 extern bool (*SetCurrentKeyboardLayoutByName)(const std::string& layout_name); | 50 extern bool (*SetCurrentKeyboardLayoutByName)(const std::string& layout_name); |
48 | 51 |
49 // Remaps modifier keys. This function does not change the current keyboard | 52 // Remaps modifier keys. This function does not change the current keyboard |
50 // layout. Returns true on success. | 53 // layout. Returns true on success. |
51 // Notice: For now, you can't remap Left Control and Left Alt keys to CapsLock. | 54 // Notice: For now, you can't remap Left Control and Left Alt keys to CapsLock. |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 // { kLeftControlKey -> kVoidKey }, | 132 // { kLeftControlKey -> kVoidKey }, |
130 // { kLeftAltKey -> kLeftAltKey }} | 133 // { kLeftAltKey -> kLeftAltKey }} |
131 bool ExtractModifierMapFromFullXkbLayoutName( | 134 bool ExtractModifierMapFromFullXkbLayoutName( |
132 const std::string& full_xkb_layout_name, | 135 const std::string& full_xkb_layout_name, |
133 const StringToModifierMap& string_to_modifier_map, | 136 const StringToModifierMap& string_to_modifier_map, |
134 ModifierMap* out_modifier_map); | 137 ModifierMap* out_modifier_map); |
135 | 138 |
136 } // namespace chromeos | 139 } // namespace chromeos |
137 | 140 |
138 #endif // CHROMEOS_KEYBOARD_H_ | 141 #endif // CHROMEOS_KEYBOARD_H_ |
OLD | NEW |