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

Side by Side Diff: ui/base/keycodes/keyboard_code_conversion_gtk.cc

Issue 17093002: Remove KeyboardCodeFromGdkEventKey. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 6 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 unified diff | Download patch
« no previous file with comments | « ui/base/keycodes/keyboard_code_conversion_gtk.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 75
76 int native_keycode = 0; 76 int native_keycode = 0;
77 if (keyval && gdk_keymap_get_entries_for_keyval(0, keyval, &keys, &n_keys)) { 77 if (keyval && gdk_keymap_get_entries_for_keyval(0, keyval, &keys, &n_keys)) {
78 native_keycode = keys[0].keycode; 78 native_keycode = keys[0].keycode;
79 g_free(keys); 79 g_free(keys);
80 } 80 }
81 81
82 return native_keycode; 82 return native_keycode;
83 } 83 }
84 84
85 KeyboardCode KeyboardCodeFromGdkEventKey(GdkEventKey* event) {
86 KeyboardCode keycode = WindowsKeyCodeForGdkKeyCode(event->keyval);
87 // Gtk's key values are same as X11's keysyms.
88 if (keycode == VKEY_UNKNOWN) {
89 unsigned int keyval =
90 DefaultXKeysymFromHardwareKeycode(event->hardware_keycode);
91 keycode = WindowsKeyCodeForGdkKeyCode(keyval);
92 }
93 return keycode;
94 }
95
96 } // namespace ui 85 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/keycodes/keyboard_code_conversion_gtk.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698