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

Unified Diff: ui/events/keycodes/keyboard_code_conversion_x.cc

Issue 243143002: linux-aura: Supports Compose key with XIM. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed review comments. Created 6 years, 8 months 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 | « ui/events/keycodes/keyboard_code_conversion_x.h ('k') | ui/events/x/events_x.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/keycodes/keyboard_code_conversion_x.cc
diff --git a/ui/events/keycodes/keyboard_code_conversion_x.cc b/ui/events/keycodes/keyboard_code_conversion_x.cc
index b21164e63385deb322baed849fc9eb807cbe4735..bc0be07a2a2473fe65c7231bc08b891f7af76d8d 100644
--- a/ui/events/keycodes/keyboard_code_conversion_x.cc
+++ b/ui/events/keycodes/keyboard_code_conversion_x.cc
@@ -810,4 +810,18 @@ int XKeysymForWindowsKeyCode(KeyboardCode keycode, bool shift) {
}
}
+bool IsXKeyEventFabricatedByIme(XEvent* xev) {
+ // XIM fabricates key events for the character compositions by XK_Multi_key.
+ // For example, when a user hits XK_Multi_key, XK_apostrophe, and XK_e in
+ // order to input "é", then XIM generates a key event with keycode=0 and
+ // state=0 for the composition, and the sequence of X11 key events will be
+ // XK_Multi_key, XK_apostrophe, **NoSymbol**, and XK_e.
+ //
+ // We have to send these fabricated key events to XIM so it can correctly
+ // handle the character compositions.
+ const bool fabricated_by_xim = xev->xkey.keycode == 0 && xev->xkey.state == 0;
sadrul 2014/04/23 14:30:58 Can you add this function in events_x.cc instead (
Yuki 2014/04/23 15:18:46 Done.
+
+ return fabricated_by_xim;
+}
+
} // namespace ui
« no previous file with comments | « ui/events/keycodes/keyboard_code_conversion_x.h ('k') | ui/events/x/events_x.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698