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

Unified Diff: chrome/browser/automation/ui_controls_linux.cc

Issue 235025: Use windows keycodes under linux (and all non-windows platforms). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 3 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 | « chrome/browser/automation/ui_controls.h ('k') | chrome/browser/views/accelerator_table_gtk.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/automation/ui_controls_linux.cc
===================================================================
--- chrome/browser/automation/ui_controls_linux.cc (revision 27238)
+++ chrome/browser/automation/ui_controls_linux.cc (working copy)
@@ -8,6 +8,7 @@
#include <gdk/gdkkeysyms.h>
#include "base/gfx/rect.h"
+#include "base/keyboard_code_conversion_gtk.h"
#include "base/logging.h"
#include "base/message_loop.h"
#include "chrome/common/gtk_util.h"
@@ -87,7 +88,7 @@
Task* followup_;
};
-bool SendKeyEvent(GdkWindow* window, bool press, guint key, guint state) {
+bool SendKeyEvent(GdkWindow* window, bool press, guint gdk_key, guint state) {
GdkEvent* event = gdk_event_new(press ? GDK_KEY_PRESS : GDK_KEY_RELEASE);
event->key.type = press ? GDK_KEY_PRESS : GDK_KEY_RELEASE;
@@ -97,7 +98,7 @@
event->key.time = EventTimeNow();
event->key.state = state;
- event->key.keyval = key;
+ event->key.keyval = gdk_key;
GdkKeymapKey* keys;
gint n_keys;
@@ -195,6 +196,8 @@
guint state = (control ? GDK_CONTROL_MASK : 0) |
(shift ? GDK_SHIFT_MASK : 0) |
(alt ? GDK_MOD1_MASK : 0);
+
+ key = base::GdkKeyCodeForWindowsKeyCode(key);
rv = rv && SendKeyEvent(event_window, true, key, state);
rv = rv && SendKeyEvent(event_window, false, key, state);
« no previous file with comments | « chrome/browser/automation/ui_controls.h ('k') | chrome/browser/views/accelerator_table_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698