summaryrefslogtreecommitdiffstats
path: root/ui/aura/event.h
diff options
context:
space:
mode:
authoryusukes@chromium.org <yusukes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-12 00:35:57 +0000
committeryusukes@chromium.org <yusukes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-12 00:35:57 +0000
commit162ce66cac211d450f037a2f35f70df1f7e7e2a8 (patch)
tree6c1f87580c14d045b971e6a070dd4b2af1912137 /ui/aura/event.h
parent890a1fcbec19ed05cb12ef8e73d3f68c3c2753e7 (diff)
downloadchromium_src-162ce66cac211d450f037a2f35f70df1f7e7e2a8.zip
chromium_src-162ce66cac211d450f037a2f35f70df1f7e7e2a8.tar.gz
chromium_src-162ce66cac211d450f037a2f35f70df1f7e7e2a8.tar.bz2
Port IsShiftDown() and variants in views::Event to aura::Event.
They will be used for implementing Aura IME. BUG=chromium:97261 TEST=try Review URL: http://codereview.chromium.org/8537012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109741 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura/event.h')
-rw-r--r--ui/aura/event.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/ui/aura/event.h b/ui/aura/event.h
index 95ac53c..33ade73 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);