Index: chrome/browser/chromeos/input_method/xkeyboard.h |
diff --git a/chrome/browser/chromeos/input_method/xkeyboard.h b/chrome/browser/chromeos/input_method/xkeyboard.h |
index 27c671491db0715ca4b8f621f24f208f4b44f4cf..cf8cdc0c1f782feb90ed92ca703361d9ad0b1fec 100644 |
--- a/chrome/browser/chromeos/input_method/xkeyboard.h |
+++ b/chrome/browser/chromeos/input_method/xkeyboard.h |
@@ -68,6 +68,33 @@ class XKeyboard { |
// xinput_hierarchy_changed_event_listener.h for details. |
bool ReapplyCurrentKeyboardLayout(); |
+ // Updates keyboard LEDs on all keyboards. |
+ // XKB asymmetrically propagates keyboard modifier indicator state changes to |
+ // slave keyboards. If the state change is initiated from a client to the |
+ // "core/master keyboard", XKB changes global state and pushes an indication |
+ // change down to all keyboards. If the state change is initiated by one slave |
+ // (physical) keyboard, it changes global state but only pushes an indicator |
+ // state change down to that one keyboard. |
+ // This function changes LEDs on all keyboards by explicitly updating |
+ // "core/master keyboard". |
+ void ReapplyCurrentModifierLockStatus(); |
+ |
+ // Returns true if num lock is enabled. Do not call the function from non-UI |
+ // threads. |
+ static bool NumLockIsEnabled(unsigned int num_lock_mask); |
+ |
+ // Sets the num lock status to |enable_num_lock|. Do not call the function |
+ // from non-UI threads. |
+ void SetNumLockEnabled(bool enable_num_lock); |
+ |
+ // Returns true if caps lock is enabled. Do not call the function from non-UI |
+ // threads. |
+ static bool CapsLockIsEnabled(); |
+ |
+ // Sets the caps lock status to |enable_caps_lock|. Do not call the function |
+ // from non-UI threads. |
+ void SetCapsLockEnabled(bool enable_caps_lock); |
+ |
// Turns on and off the auto-repeat of the keyboard. Returns true on success. |
// Do not call the function from non-UI threads. |
static bool SetAutoRepeatEnabled(bool enabled); |
@@ -77,13 +104,8 @@ class XKeyboard { |
// non-UI threads. |
static bool SetAutoRepeatRate(const AutoRepeatRate& rate); |
- // Returns true if caps lock is enabled. Do not call the function from non-UI |
- // threads. |
- static bool CapsLockIsEnabled(); |
- |
- // Sets the caps lock status to |enable_caps_lock|. Do not call the function |
- // from non-UI threads. |
- static void SetCapsLockEnabled(bool enabled); |
+ // Returns a mask (e.g. 1U<<4) for Num Lock. On error, returns 0. |
+ static unsigned int GetNumLockMask(); |
protected: |
// Creates a full XKB layout name like |
@@ -127,18 +149,23 @@ class XKeyboard { |
// Called when execve'd setxkbmap process exits. |
static void OnSetLayoutFinish(pid_t pid, int status, XKeyboard* self); |
+ const bool is_running_on_chrome_os_; |
+ unsigned int num_lock_mask_; |
+ |
+ // The current Num Lock and Caps Lock status. If true, enabled. |
+ bool current_num_lock_status_; |
+ bool current_caps_lock_status_; |
// The XKB layout name which we set last time like "us" and "us(dvorak)". |
std::string current_layout_name_; |
// The mapping of modifier keys we set last time. |
ModifierMap current_modifier_map_; |
+ |
// A queue for executing setxkbmap one by one. |
std::queue<std::string> execute_queue_; |
std::set<std::string> keep_right_alt_xkb_layout_names_; |
std::set<std::string> caps_lock_remapped_xkb_layout_names_; |
- const bool is_running_on_chrome_os_; |
- |
DISALLOW_COPY_AND_ASSIGN(XKeyboard); |
}; |