Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /* | 5 /* |
| 6 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. | 6 * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. |
| 7 * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com | 7 * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com |
| 8 * Copyright (C) 2007 Holger Hans Peter Freyther | 8 * Copyright (C) 2007 Holger Hans Peter Freyther |
| 9 * Copyright (C) 2008 Collabora, Ltd. All rights reserved. | 9 * Copyright (C) 2008 Collabora, Ltd. All rights reserved. |
| 10 * Copyright (C) 2008, 2009 Google Inc. | 10 * Copyright (C) 2008, 2009 Google Inc. |
| (...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 627 // Gtk's key values are same as X11's keysyms. | 627 // Gtk's key values are same as X11's keysyms. |
| 628 if (keycode == VKEY_UNKNOWN) { | 628 if (keycode == VKEY_UNKNOWN) { |
| 629 unsigned int keyval = | 629 unsigned int keyval = |
| 630 DefaultXKeysymFromHardwareKeycode(event->hardware_keycode); | 630 DefaultXKeysymFromHardwareKeycode(event->hardware_keycode); |
| 631 keycode = WindowsKeyCodeForGdkKeyCode(keyval); | 631 keycode = WindowsKeyCodeForGdkKeyCode(keyval); |
| 632 } | 632 } |
| 633 #endif | 633 #endif |
| 634 return keycode; | 634 return keycode; |
| 635 } | 635 } |
| 636 | 636 |
| 637 // For WebKit DRT testing: simulate the native keycode for the given | |
| 638 // 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.
| |
| 639 int GdkNativeKeyCodeForWindowsKeyCode(KeyboardCode keycode, bool shift) { | |
| 640 int keyval = GdkKeyCodeForWindowsKeyCode(keycode, shift); | |
| 641 GdkKeymapKey* keys; | |
| 642 gint n_keys; | |
| 643 if (keyval && gdk_keymap_get_entries_for_keyval(0, keyval, &keys, &n_keys)) | |
| 644 return keys[0].keycode; | |
| 645 return 0; | |
| 646 } | |
| 647 | |
| 637 } // namespace ui | 648 } // namespace ui |
| OLD | NEW |