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

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

Issue 6674052: [cros] Fix accelerator keys when using non-US/Latin keyboard layouts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 9 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 | « ui/base/keycodes/keyboard_code_conversion_gtk.h ('k') | ui/base/keycodes/keyboard_code_conversion_x.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/keycodes/keyboard_code_conversion_gtk.cc
diff --git a/ui/base/keycodes/keyboard_code_conversion_gtk.cc b/ui/base/keycodes/keyboard_code_conversion_gtk.cc
index 6545d7ea0c3a07756bf120bd4c783599e7d4db53..4425b883b02118c51ec682d99a88a11ece4962fa 100644
--- a/ui/base/keycodes/keyboard_code_conversion_gtk.cc
+++ b/ui/base/keycodes/keyboard_code_conversion_gtk.cc
@@ -35,10 +35,16 @@
#include "ui/base/keycodes/keyboard_code_conversion_gtk.h"
+#include <gdk/gdk.h>
#include <gdk/gdkkeysyms.h>
+#include "build/build_config.h"
#include "ui/base/keycodes/keyboard_codes_posix.h"
+#ifdef USE_X11
+#include "ui/base/keycodes/keyboard_code_conversion_x.h"
+#endif
+
namespace ui {
KeyboardCode WindowsKeyCodeForGdkKeyCode(int keycode) {
@@ -615,4 +621,17 @@ int GdkKeyCodeForWindowsKeyCode(KeyboardCode keycode, bool shift) {
}
}
+KeyboardCode KeyboardCodeFromGdkEventKey(GdkEventKey* event) {
+ KeyboardCode keycode = WindowsKeyCodeForGdkKeyCode(event->keyval);
+#ifdef USE_X11
+ // Gtk's key values are same as X11's keysyms.
+ if (keycode == VKEY_UNKNOWN) {
+ unsigned int keyval =
+ DefaultXKeysymFromHardwareKeycode(event->hardware_keycode);
+ keycode = WindowsKeyCodeForGdkKeyCode(keyval);
+ }
+#endif
+ return keycode;
+}
+
} // namespace ui
« no previous file with comments | « ui/base/keycodes/keyboard_code_conversion_gtk.h ('k') | ui/base/keycodes/keyboard_code_conversion_x.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698