| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 ASH_STICKY_KEYS_STICKY_KEYS_CONTROLLER_H_ | 5 #ifndef ASH_STICKY_KEYS_STICKY_KEYS_CONTROLLER_H_ |
| 6 #define ASH_STICKY_KEYS_STICKY_KEYS_CONTROLLER_H_ | 6 #define ASH_STICKY_KEYS_STICKY_KEYS_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 // of pending events still remaining to be returned. | 219 // of pending events still remaining to be returned. |
| 220 int GetModifierUpEvent(std::unique_ptr<ui::Event>* new_event); | 220 int GetModifierUpEvent(std::unique_ptr<ui::Event>* new_event); |
| 221 | 221 |
| 222 // Returns current internal state. | 222 // Returns current internal state. |
| 223 StickyKeyState current_state() const { return current_state_; } | 223 StickyKeyState current_state() const { return current_state_; } |
| 224 | 224 |
| 225 private: | 225 private: |
| 226 // Represents event type in Sticky Key context. | 226 // Represents event type in Sticky Key context. |
| 227 enum KeyEventType { | 227 enum KeyEventType { |
| 228 TARGET_MODIFIER_DOWN, // The monitoring modifier key is down. | 228 TARGET_MODIFIER_DOWN, // The monitoring modifier key is down. |
| 229 TARGET_MODIFIER_UP, // The monitoring modifier key is up. | 229 TARGET_MODIFIER_UP, // The monitoring modifier key is up. |
| 230 NORMAL_KEY_DOWN, // The non modifier key is down. | 230 NORMAL_KEY_DOWN, // The non modifier key is down. |
| 231 NORMAL_KEY_UP, // The non modifier key is up. | 231 NORMAL_KEY_UP, // The non modifier key is up. |
| 232 OTHER_MODIFIER_DOWN, // The modifier key but not monitored key is down. | 232 OTHER_MODIFIER_DOWN, // The modifier key but not monitored key is down. |
| 233 OTHER_MODIFIER_UP, // The modifier key but not monitored key is up. | 233 OTHER_MODIFIER_UP, // The modifier key but not monitored key is up. |
| 234 }; | 234 }; |
| 235 | 235 |
| 236 // Translates event type and key code to sticky keys event type. | 236 // Translates event type and key code to sticky keys event type. |
| 237 KeyEventType TranslateKeyEvent(ui::EventType type, ui::KeyboardCode key_code); | 237 KeyEventType TranslateKeyEvent(ui::EventType type, ui::KeyboardCode key_code); |
| 238 | 238 |
| 239 // Handles key event in DISABLED state. Returns true if sticky keys | 239 // Handles key event in DISABLED state. Returns true if sticky keys |
| 240 // consumes the keyboard event. | 240 // consumes the keyboard event. |
| 241 bool HandleDisabledState(const ui::KeyEvent& event, | 241 bool HandleDisabledState(const ui::KeyEvent& event, |
| 242 ui::KeyboardCode key_code); | 242 ui::KeyboardCode key_code); |
| 243 | 243 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 274 | 274 |
| 275 // The modifier up key event to be sent on non modifier key on ENABLED state. | 275 // The modifier up key event to be sent on non modifier key on ENABLED state. |
| 276 std::unique_ptr<ui::KeyEvent> modifier_up_event_; | 276 std::unique_ptr<ui::KeyEvent> modifier_up_event_; |
| 277 | 277 |
| 278 DISALLOW_COPY_AND_ASSIGN(StickyKeysHandler); | 278 DISALLOW_COPY_AND_ASSIGN(StickyKeysHandler); |
| 279 }; | 279 }; |
| 280 | 280 |
| 281 } // namespace ash | 281 } // namespace ash |
| 282 | 282 |
| 283 #endif // ASH_STICKY_KEYS_STICKY_KEYS_CONTROLLER_H_ | 283 #endif // ASH_STICKY_KEYS_STICKY_KEYS_CONTROLLER_H_ |
| OLD | NEW |