OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_EVENT_H_ | 5 #ifndef UI_EVENTS_EVENT_H_ |
6 #define UI_EVENTS_EVENT_H_ | 6 #define UI_EVENTS_EVENT_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/event_types.h" | 10 #include "base/event_types.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 // events that are not cancelable. | 76 // events that are not cancelable. |
77 bool cancelable() const { return cancelable_; } | 77 bool cancelable() const { return cancelable_; } |
78 | 78 |
79 // The following methods return true if the respective keys were pressed at | 79 // The following methods return true if the respective keys were pressed at |
80 // the time the event was created. | 80 // the time the event was created. |
81 bool IsShiftDown() const { return (flags_ & EF_SHIFT_DOWN) != 0; } | 81 bool IsShiftDown() const { return (flags_ & EF_SHIFT_DOWN) != 0; } |
82 bool IsControlDown() const { return (flags_ & EF_CONTROL_DOWN) != 0; } | 82 bool IsControlDown() const { return (flags_ & EF_CONTROL_DOWN) != 0; } |
83 bool IsCapsLockDown() const { return (flags_ & EF_CAPS_LOCK_DOWN) != 0; } | 83 bool IsCapsLockDown() const { return (flags_ & EF_CAPS_LOCK_DOWN) != 0; } |
84 bool IsAltDown() const { return (flags_ & EF_ALT_DOWN) != 0; } | 84 bool IsAltDown() const { return (flags_ & EF_ALT_DOWN) != 0; } |
85 bool IsAltGrDown() const { return (flags_ & EF_ALTGR_DOWN) != 0; } | 85 bool IsAltGrDown() const { return (flags_ & EF_ALTGR_DOWN) != 0; } |
| 86 bool IsCommandDown() const { return (flags_ & EF_COMMAND_DOWN) != 0; } |
86 bool IsRepeat() const { return (flags_ & EF_IS_REPEAT) != 0; } | 87 bool IsRepeat() const { return (flags_ & EF_IS_REPEAT) != 0; } |
87 | 88 |
88 bool IsKeyEvent() const { | 89 bool IsKeyEvent() const { |
89 return type_ == ET_KEY_PRESSED || | 90 return type_ == ET_KEY_PRESSED || |
90 type_ == ET_KEY_RELEASED || | 91 type_ == ET_KEY_RELEASED || |
91 type_ == ET_TRANSLATED_KEY_PRESS || | 92 type_ == ET_TRANSLATED_KEY_PRESS || |
92 type_ == ET_TRANSLATED_KEY_RELEASE; | 93 type_ == ET_TRANSLATED_KEY_RELEASE; |
93 } | 94 } |
94 | 95 |
95 bool IsMouseEvent() const { | 96 bool IsMouseEvent() const { |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
678 | 679 |
679 const GestureEventDetails& details() const { return details_; } | 680 const GestureEventDetails& details() const { return details_; } |
680 | 681 |
681 private: | 682 private: |
682 GestureEventDetails details_; | 683 GestureEventDetails details_; |
683 }; | 684 }; |
684 | 685 |
685 } // namespace ui | 686 } // namespace ui |
686 | 687 |
687 #endif // UI_EVENTS_EVENT_H_ | 688 #endif // UI_EVENTS_EVENT_H_ |
OLD | NEW |