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

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: revised 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..88bcc441e96275da298ac71c9219944a6c6c5175 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) {
+ if ((keysym > 0xff00 && keysym < 0xff1f) || keysym == XK_Delete)
Yuki 2014/10/23 07:13:56 keysym <= 0xff1f ? I think we'd like to include 0x
Shu Chen 2014/10/23 07:44:33 Done.
+ return true;
+ return false;
+}
+
} // 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) {
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