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-16 11:57:18 +0000
committeryusukes@chromium.org <yusukes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-16 11:57:18 +0000
commit93bd9156711ff16a859ef8c459740a6e71f058c7 (patch)
tree0c2f4432543870b16c36235a95fa3e0b800955a8 /ui/aura/event.h
parentc310b4fabe7f113fe6d54d38a36630021e689456 (diff)
downloadchromium_src-93bd9156711ff16a859ef8c459740a6e71f058c7.zip
chromium_src-93bd9156711ff16a859ef8c459740a6e71f058c7.tar.gz
chromium_src-93bd9156711ff16a859ef8c459740a6e71f058c7.tar.bz2
Port views::KeyEvent functions to aura::KeyEvent.
They will be used for adding IME support to Aura. BUG=chromium:97261 TEST=try Review URL: http://codereview.chromium.org/8567021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110288 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura/event.h')
-rw-r--r--ui/aura/event.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/ui/aura/event.h b/ui/aura/event.h
index 33ade73..e01e6c2 100644
--- a/ui/aura/event.h
+++ b/ui/aura/event.h
@@ -150,6 +150,23 @@ class AURA_EXPORT KeyEvent : public Event {
ui::KeyboardCode key_code,
int flags);
+ // These setters allow an I18N virtual keyboard to fabricate a keyboard event
+ // which does not have a corresponding ui::KeyboardCode (example: U+00E1 Latin
+ // small letter A with acute, U+0410 Cyrillic capital letter A.)
+ // GetCharacter() and GetUnmodifiedCharacter() return the character.
+ void set_character(uint16 character) { character_ = character; }
+ void set_unmodified_character(uint16 unmodified_character) {
+ unmodified_character_ = unmodified_character;
+ }
+
+ // Gets the character generated by this key event. It only supports Unicode
+ // BMP characters.
+ uint16 GetCharacter() const;
+
+ // Gets the character generated by this key event ignoring concurrently-held
+ // modifiers (except shift).
+ uint16 GetUnmodifiedCharacter() const;
+
ui::KeyboardCode key_code() const { return key_code_; }
bool is_char() const { return is_char_; }
@@ -158,6 +175,9 @@ class AURA_EXPORT KeyEvent : public Event {
// True if this is a translated character event (vs. a raw key down). Both
// share the same type: ui::ET_KEY_PRESSED.
bool is_char_;
+
+ uint16 character_;
+ uint16 unmodified_character_;
};
} // namespace aura