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 a4a810e23a43004eb09af168daa797968e6d8a23..0bf3c7fb1a11c9825558a5f3fa74de57e390250b 100644 |
| --- a/ui/events/keycodes/keyboard_code_conversion_x.cc |
| +++ b/ui/events/keycodes/keyboard_code_conversion_x.cc |
| @@ -459,6 +459,12 @@ KeyboardCode FindVK(const T_MAP& key, const T_MAP* map, size_t size) { |
| return VKEY_UNKNOWN; |
| } |
| +bool IsAsciiControlKey(KeySym keysym) { |
| + // 0xff01 to 0xff1f (instead of 0x01 to 0x1f) represent ASCII control in |
| + // keysym world. |
| + return (keysym > 0xff00 && keysym <= 0xff1f) || keysym == XK_Delete; |
|
Wez
2014/10/24 01:17:44
Why is XK_Delete in here? It's not a Ctrl+<ascii>
Shu Chen
2014/10/24 01:26:58
Please refer to:
http://en.wikipedia.org/wiki/Cont
Wez
2014/10/24 01:43:14
OK, understood; please make sure the CL descriptio
|
| +} |
| + |
| } // namespace |
| // Get an ui::KeyboardCode from an X keyevent |
| @@ -492,7 +498,8 @@ KeyboardCode KeyboardCodeFromXKeyEvent(const XEvent* xev) { |
| XLookupString(xkey, NULL, 0, &keysym, NULL); |
| if (IsKeypadKey(keysym) || IsPrivateKeypadKey(keysym) || |
| IsCursorKey(keysym) || IsPFKey(keysym) || IsFunctionKey(keysym) || |
| - IsModifierKey(keysym)) { |
| + IsModifierKey(keysym) || IsAsciiControlKey(keysym) || |
| + keysym == XK_space) { |
|
Wez
2014/10/24 01:17:44
could/should space go in IsAsciiControlKey?
Shu Chen
2014/10/24 01:26:58
Ditto.
Wez
2014/10/24 01:43:14
?
As currently laid out it's confusing that space
|
| return KeyboardCodeFromXKeysym(keysym); |
| } |