Chromium Code Reviews| 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 |