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

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

Issue 7740048: Chrome Linux DRT nativeKeyCode helper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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') | webkit/support/webkit_support.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 4425b883b02118c51ec682d99a88a11ece4962fa..a3ee6f34512560dc232687eaa1e3d34b6a9846ec 100644
--- a/ui/base/keycodes/keyboard_code_conversion_gtk.cc
+++ b/ui/base/keycodes/keyboard_code_conversion_gtk.cc
@@ -634,4 +634,15 @@ KeyboardCode KeyboardCodeFromGdkEventKey(GdkEventKey* event) {
return keycode;
}
+// For WebKit DRT testing: simulate the native keycode for the given
+// input |keycode|. Return the native keycode.
tony 2011/08/26 16:24:51 Nit: I would probably move this comment to the hea
Noel Gordon 2011/08/26 16:42:12 Done.
+int GdkNativeKeyCodeForWindowsKeyCode(KeyboardCode keycode, bool shift) {
+ int keyval = GdkKeyCodeForWindowsKeyCode(keycode, shift);
+ GdkKeymapKey* keys;
+ gint n_keys;
+ if (keyval && gdk_keymap_get_entries_for_keyval(0, keyval, &keys, &n_keys))
+ return keys[0].keycode;
+ return 0;
+}
+
} // namespace ui
« no previous file with comments | « ui/base/keycodes/keyboard_code_conversion_gtk.h ('k') | webkit/support/webkit_support.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698