summaryrefslogtreecommitdiffstats
path: root/views/event_gtk.cc
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-25 23:15:41 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-25 23:15:41 +0000
commitc566c610480e0d8e915193c058f415a7660d48b5 (patch)
treef36460711defe77bb82f060ab1aa005a24de5475 /views/event_gtk.cc
parente098ce874e942a11083116f848310d026e8c37c8 (diff)
downloadchromium_src-c566c610480e0d8e915193c058f415a7660d48b5.zip
chromium_src-c566c610480e0d8e915193c058f415a7660d48b5.tar.gz
chromium_src-c566c610480e0d8e915193c058f415a7660d48b5.tar.bz2
[Relanding erg's change with fix for toolkit_views shortcuts and
interactive ui tests. Note that this was originally reviewed in http://codereview.chromium.org/217022/show I originally Elliot suggestion of replacing the usage of int for keycode with the bae::Keycode type, but that led to the CL getting out of hands (as this is used in many different places). So this is only the patch set 1 of that CL, I'll replace the type in another CL] Use windows keycodes under linux (and all non-windows platforms). This fixes any place where we use a VKEY_* (RenderWidgetHost, for example) under Linux, but breaks accelerators in TOOLKIT_VIEWS which relied on this wrong behaviour. Previously, keyboard_codes_linux defined all the VKEY_* constants as their GDK_* counterparts, which is wrong since the VKEY_* are supposed to resolve to windows key codes. BUG=22551 TEST=Make sure accelerators still work as expected on Chrome Linux and Chrome Linux with toolkit views. Test when the the accelerators with the focus in the location bar and also with the focus on the page. Review URL: http://codereview.chromium.org/235025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27284 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/event_gtk.cc')
-rw-r--r--views/event_gtk.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/views/event_gtk.cc b/views/event_gtk.cc
index 6f1e450..71fd056 100644
--- a/views/event_gtk.cc
+++ b/views/event_gtk.cc
@@ -6,18 +6,19 @@
#include <gdk/gdk.h>
+#include "base/keyboard_code_conversion_gtk.h"
+
namespace views {
// TODO(jcampan): the same physical key can send different keyvals (ex: a or A).
// In order for accelerators to work, we need to normalize that. The right
// solution should probably to get the key-code out of the keystate.
-KeyEvent::KeyEvent(GdkEventKey* event, bool make_lower_case)
+KeyEvent::KeyEvent(GdkEventKey* event)
: Event(event->type == GDK_KEY_PRESS ?
Event::ET_KEY_PRESSED : Event::ET_KEY_RELEASED,
GetFlagsFromGdkState(event->state)),
// TODO(erg): All these values are iffy.
- character_(make_lower_case ? gdk_keyval_to_lower(event->keyval) :
- event->keyval),
+ character_(base::WindowsKeyCodeForGdkKeyCode(event->keyval)),
repeat_count_(0),
message_flags_(0) {
}