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_EVENT_MODIFIERS_EVDEV_H_ | 5 #ifndef UI_EVENTS_OZONE_EVDEV_EVENT_MODIFIERS_EVDEV_H_ |
6 #define UI_EVENTS_OZONE_EVDEV_EVENT_MODIFIERS_EVDEV_H_ | 6 #define UI_EVENTS_OZONE_EVDEV_EVENT_MODIFIERS_EVDEV_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "ui/events/events_export.h" | 9 #include "ui/events/events_export.h" |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 | 46 |
47 // Record key press or release for regular modifier key (shift, alt, etc). | 47 // Record key press or release for regular modifier key (shift, alt, etc). |
48 void UpdateModifier(unsigned int modifier, bool down); | 48 void UpdateModifier(unsigned int modifier, bool down); |
49 | 49 |
50 // Record key press or release for locking modifier key (caps lock). | 50 // Record key press or release for locking modifier key (caps lock). |
51 void UpdateModifierLock(unsigned int modifier, bool down); | 51 void UpdateModifierLock(unsigned int modifier, bool down); |
52 | 52 |
53 // Return current flags to use for incoming events. | 53 // Return current flags to use for incoming events. |
54 int GetModifierFlags(); | 54 int GetModifierFlags(); |
55 | 55 |
| 56 // Return the mask for the specified modifier. |
| 57 static int GetEventFlagFromModifier(unsigned int modifier); |
| 58 |
56 private: | 59 private: |
57 // Count of keys pressed for each modifier. | 60 // Count of keys pressed for each modifier. |
58 int modifiers_down_[EVDEV_NUM_MODIFIERS]; | 61 int modifiers_down_[EVDEV_NUM_MODIFIERS]; |
59 | 62 |
60 // Mask of modifier flags currently "locked". | 63 // Mask of modifier flags currently "locked". |
61 int modifier_flags_locked_; | 64 int modifier_flags_locked_; |
62 | 65 |
63 // Mask of modifier flags currently active (nonzero keys pressed xor locked). | 66 // Mask of modifier flags currently active (nonzero keys pressed xor locked). |
64 int modifier_flags_; | 67 int modifier_flags_; |
65 | 68 |
66 // Update modifier_flags_ from modifiers_down_ and modifier_flags_locked_. | 69 // Update modifier_flags_ from modifiers_down_ and modifier_flags_locked_. |
67 void UpdateFlags(unsigned int modifier); | 70 void UpdateFlags(unsigned int modifier); |
68 | 71 |
69 DISALLOW_COPY_AND_ASSIGN(EventModifiersEvdev); | 72 DISALLOW_COPY_AND_ASSIGN(EventModifiersEvdev); |
70 }; | 73 }; |
71 | 74 |
72 } // namspace ui | 75 } // namspace ui |
73 | 76 |
74 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_MODIFIERS_EVDEV_H_ | 77 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_MODIFIERS_EVDEV_H_ |
OLD | NEW |