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

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

Issue 8803004: Consolidate two very similar functions; ui::WindowsKeyCodeForGdkKeyCode and ui::KeyboardCodeFromXKey (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years 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 | « ui/base/keycodes/keyboard_code_conversion_gtk.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/keycodes/keyboard_code_conversion_x.cc
diff --git a/ui/base/keycodes/keyboard_code_conversion_x.cc b/ui/base/keycodes/keyboard_code_conversion_x.cc
index df5bf68aacd2b779172d8a843ca9e6081bd86ff9..00a4e1bc43d0407b462fb5c0a6765a29dd46ae25 100644
--- a/ui/base/keycodes/keyboard_code_conversion_x.cc
+++ b/ui/base/keycodes/keyboard_code_conversion_x.cc
@@ -4,6 +4,7 @@
#include "ui/base/keycodes/keyboard_code_conversion_x.h"
+#define XK_3270 // for XK_3270_BackTab
#include <X11/keysym.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
@@ -31,9 +32,6 @@ KeyboardCode KeyboardCodeFromXKeyEvent(XEvent* xev) {
}
KeyboardCode KeyboardCodeFromXKeysym(unsigned int keysym) {
- // Consult GDK key translation (in WindowsKeyCodeForGdkKeyCode) for details
- // about the following translations.
-
// TODO(sad): Have |keysym| go through the X map list?
switch (keysym) {
@@ -45,10 +43,12 @@ KeyboardCode KeyboardCodeFromXKeysym(unsigned int keysym) {
case XK_Tab:
case XK_KP_Tab:
case XK_ISO_Left_Tab:
+ case XK_3270_BackTab:
return VKEY_TAB;
case XK_Linefeed:
case XK_Return:
case XK_KP_Enter:
+ case XK_ISO_Enter:
return VKEY_RETURN;
case XK_Clear:
return VKEY_CLEAR;
@@ -81,6 +81,15 @@ KeyboardCode KeyboardCodeFromXKeysym(unsigned int keysym) {
return VKEY_UP;
case XK_Escape:
return VKEY_ESCAPE;
+ case XK_Kana_Lock:
+ case XK_Kana_Shift:
+ return VKEY_KANA;
+ case XK_Hangul:
+ return VKEY_HANGUL;
+ case XK_Hangul_Hanja:
+ return VKEY_HANJA;
+ case XK_Kanji:
+ return VKEY_KANJI;
case XK_A:
case XK_a:
return VKEY_A;
« no previous file with comments | « ui/base/keycodes/keyboard_code_conversion_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698