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 |