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

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

Issue 664893004: If keysym is ASCII control or space keys, directly map to keycode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: modified per comments. Created 6 years, 2 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 | no next file » | 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 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);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698