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_EVDEV_KEYBOARD_EVDEV_H_ | 5 #ifndef UI_EVENTS_OZONE_EVDEV_KEYBOARD_EVDEV_H_ |
6 #define UI_EVENTS_OZONE_EVDEV_KEYBOARD_EVDEV_H_ | 6 #define UI_EVENTS_OZONE_EVDEV_KEYBOARD_EVDEV_H_ |
7 | 7 |
8 #include <bitset> | 8 #include <bitset> |
9 #include <linux/input.h> | 9 #include <linux/input.h> |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 KeyboardLayoutEngine* keyboard_layout_engine, | 34 KeyboardLayoutEngine* keyboard_layout_engine, |
35 const EventDispatchCallback& callback); | 35 const EventDispatchCallback& callback); |
36 ~KeyboardEvdev(); | 36 ~KeyboardEvdev(); |
37 | 37 |
38 static int NativeCodeToEvdevCode(int native_code); | 38 static int NativeCodeToEvdevCode(int native_code); |
39 static int EvdevCodeToNativeCode(int evdev_code); | 39 static int EvdevCodeToNativeCode(int evdev_code); |
40 | 40 |
41 // Handlers for raw key presses & releases. | 41 // Handlers for raw key presses & releases. |
42 void OnKeyChange(unsigned int code, bool down); | 42 void OnKeyChange(unsigned int code, bool down); |
43 | 43 |
| 44 // Handle Caps Lock modifier. |
| 45 void SetCapsLockEnabled(bool enabled); |
| 46 bool IsCapsLockEnabled(); |
| 47 |
44 // Configuration for key repeat. | 48 // Configuration for key repeat. |
45 bool IsAutoRepeatEnabled(); | 49 bool IsAutoRepeatEnabled(); |
46 void SetAutoRepeatEnabled(bool enabled); | 50 void SetAutoRepeatEnabled(bool enabled); |
47 void SetAutoRepeatRate(const base::TimeDelta& delay, | 51 void SetAutoRepeatRate(const base::TimeDelta& delay, |
48 const base::TimeDelta& interval); | 52 const base::TimeDelta& interval); |
49 void GetAutoRepeatRate(base::TimeDelta* delay, base::TimeDelta* interval); | 53 void GetAutoRepeatRate(base::TimeDelta* delay, base::TimeDelta* interval); |
50 | 54 |
51 private: | 55 private: |
52 void UpdateModifier(int modifier_flag, bool down); | 56 void UpdateModifier(int modifier_flag, bool down); |
53 void UpdateKeyRepeat(unsigned int key, bool down); | 57 void UpdateKeyRepeat(unsigned int key, bool down); |
(...skipping 28 matching lines...) Expand all Loading... |
82 base::TimeDelta repeat_interval_; | 86 base::TimeDelta repeat_interval_; |
83 base::OneShotTimer<KeyboardEvdev> repeat_delay_timer_; | 87 base::OneShotTimer<KeyboardEvdev> repeat_delay_timer_; |
84 base::RepeatingTimer<KeyboardEvdev> repeat_interval_timer_; | 88 base::RepeatingTimer<KeyboardEvdev> repeat_interval_timer_; |
85 | 89 |
86 DISALLOW_COPY_AND_ASSIGN(KeyboardEvdev); | 90 DISALLOW_COPY_AND_ASSIGN(KeyboardEvdev); |
87 }; | 91 }; |
88 | 92 |
89 } // namespace ui | 93 } // namespace ui |
90 | 94 |
91 #endif // UI_EVENTS_OZONE_EVDEV_KEYBOARD_EVDEV_H_ | 95 #endif // UI_EVENTS_OZONE_EVDEV_KEYBOARD_EVDEV_H_ |
OLD | NEW |