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 CHROME_BROWSER_CHROMEOS_EVENTS_EVENT_REWRITER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_EVENTS_EVENT_REWRITER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_EVENTS_EVENT_REWRITER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_EVENTS_EVENT_REWRITER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 // EventRewriter makes various changes to keyboard-related events, | 29 // EventRewriter makes various changes to keyboard-related events, |
30 // including KeyEvents and some other events with keyboard modifier flags: | 30 // including KeyEvents and some other events with keyboard modifier flags: |
31 // - maps modifiers keys (Control, Alt, Search, Caps, Diamond) according | 31 // - maps modifiers keys (Control, Alt, Search, Caps, Diamond) according |
32 // to user preferences; | 32 // to user preferences; |
33 // - maps Command to Control on Apple keyboards; | 33 // - maps Command to Control on Apple keyboards; |
34 // - converts numeric pad editing keys to their numeric forms; | 34 // - converts numeric pad editing keys to their numeric forms; |
35 // - converts top-row function keys to special keys where necessary; | 35 // - converts top-row function keys to special keys where necessary; |
36 // - handles various key combinations like Search+Backspace -> Delete | 36 // - handles various key combinations like Search+Backspace -> Delete |
37 // and Search+number to Fnumber; | 37 // and Search+number to Fnumber; |
38 // - handles key/pointer combinations like Search+Button1 -> Button3. | 38 // - handles key/pointer combinations like Alt+Button1 -> Button3. |
39 class EventRewriter : public ui::EventRewriter { | 39 class EventRewriter : public ui::EventRewriter { |
40 public: | 40 public: |
41 enum DeviceType { | 41 enum DeviceType { |
42 kDeviceUnknown = 0, | 42 kDeviceUnknown = 0, |
43 kDeviceAppleKeyboard, | 43 kDeviceAppleKeyboard, |
44 kDeviceHotrodRemote, | 44 kDeviceHotrodRemote, |
45 kDeviceVirtualCoreKeyboard, // X-server generated events. | 45 kDeviceVirtualCoreKeyboard, // X-server generated events. |
46 }; | 46 }; |
47 | 47 |
48 // Does not take ownership of the |sticky_keys_controller|, which may also | 48 // Does not take ownership of the |sticky_keys_controller|, which may also |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 // While the Diamond key is down, this holds the corresponding modifier | 196 // While the Diamond key is down, this holds the corresponding modifier |
197 // ui::EventFlags; otherwise it is EF_NONE. | 197 // ui::EventFlags; otherwise it is EF_NONE. |
198 int current_diamond_key_modifier_flags_; | 198 int current_diamond_key_modifier_flags_; |
199 | 199 |
200 DISALLOW_COPY_AND_ASSIGN(EventRewriter); | 200 DISALLOW_COPY_AND_ASSIGN(EventRewriter); |
201 }; | 201 }; |
202 | 202 |
203 } // namespace chromeos | 203 } // namespace chromeos |
204 | 204 |
205 #endif // CHROME_BROWSER_CHROMEOS_EVENTS_EVENT_REWRITER_H_ | 205 #endif // CHROME_BROWSER_CHROMEOS_EVENTS_EVENT_REWRITER_H_ |
OLD | NEW |