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

Unified Diff: ui/events/x/events_x.cc

Issue 321963003: aura-linux: Supports deadkey + shift + alphabet for XIM. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added a unittest. Created 6 years, 6 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 | « no previous file | ui/events/x/events_x_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/x/events_x.cc
diff --git a/ui/events/x/events_x.cc b/ui/events/x/events_x.cc
index 9d6b15a2eca3a0dc71a833999707b1385c79e011..adc03cada2c120f62e0995e878140d0e7ecafcb7 100644
--- a/ui/events/x/events_x.cc
+++ b/ui/events/x/events_x.cc
@@ -162,12 +162,15 @@ int GetEventFlagsFromXKeyEvent(XEvent* xevent) {
// 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.
+ // XK_Multi_key, XK_apostrophe, **NoSymbol**, and XK_e. If the user used
+ // shift key and/or caps lock key, state can be ShiftMask, LockMask or both.
//
// We have to send these fabricated key events to XIM so it can correctly
// handle the character compositions.
+ const unsigned int shift_lock_mask = ShiftMask | LockMask;
const bool fabricated_by_xim =
- xevent->xkey.keycode == 0 && xevent->xkey.state == 0;
+ xevent->xkey.keycode == 0 &&
+ (xevent->xkey.state & ~shift_lock_mask) == 0;
const int ime_fabricated_flag =
fabricated_by_xim ? ui::EF_IME_FABRICATED_KEY : 0;
#endif
« no previous file with comments | « no previous file | ui/events/x/events_x_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698