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

Unified Diff: ui/aura/event.h

Issue 8567021: Port views::KeyEvent functions to aura::KeyEvent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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 | ui/aura/event.cc » ('j') | 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 33ade739d8ef11caf0995c08b2244adc0ce639aa..e01e6c25423d323c098a5f380d7ec9a99c11afd9 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
« no previous file with comments | « no previous file | ui/aura/event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698