Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Unified Diff: ui/aura/event.h

Issue 8537012: Port IsShiftDown() and variants in views::Event to aura::Event. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/event.h
diff --git a/ui/aura/event.h b/ui/aura/event.h
index 95ac53c39a9aa0d40e08508be9090cc340d37d90..33ade739d8ef11caf0995c08b2244adc0ce639aa 100644
--- a/ui/aura/event.h
+++ b/ui/aura/event.h
@@ -29,6 +29,13 @@ class AURA_EXPORT Event {
const base::Time& time_stamp() const { return time_stamp_; }
int flags() const { return flags_; }
+ // The following methods return true if the respective keys were pressed at
+ // the time the event was created.
+ bool IsShiftDown() const { return (flags_ & ui::EF_SHIFT_DOWN) != 0; }
+ bool IsControlDown() const { return (flags_ & ui::EF_CONTROL_DOWN) != 0; }
+ bool IsCapsLockDown() const { return (flags_ & ui::EF_CAPS_LOCK_DOWN) != 0; }
+ bool IsAltDown() const { return (flags_ & ui::EF_ALT_DOWN) != 0; }
+
protected:
Event(ui::EventType type, int flags);
Event(const base::NativeEvent& native_event, ui::EventType type, int flags);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698