Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: chromeos_keyboard.h

Issue 3155020: Add GetHardwareKeyboardLayoutName method instead of kHardwareLayout (Closed) Base URL: http://src.chromium.org/git/cros.git
Patch Set: add GethardwareKeyboardLayoutName() Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chromeos_cros_api.h ('k') | chromeos_keyboard.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « chromeos_cros_api.h ('k') | chromeos_keyboard.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698