summaryrefslogtreecommitdiffstats
path: root/views/event_gtk.cc
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-31 22:53:37 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-31 22:53:37 +0000
commit148d105e27c7c8c2cda0c81292690b9edafcae1f (patch)
treee278052fc84a6e5399aec5bd0d423162aecb6d16 /views/event_gtk.cc
parentdc75d4823b598a9b9b313728a06f6b47d6a73929 (diff)
downloadchromium_src-148d105e27c7c8c2cda0c81292690b9edafcae1f.zip
chromium_src-148d105e27c7c8c2cda0c81292690b9edafcae1f.tar.gz
chromium_src-148d105e27c7c8c2cda0c81292690b9edafcae1f.tar.bz2
This CL adds accelerators to the Linux toolkit views.
The MessageLoop had to be modified to support Dispatchers on Linux. BUG=None TEST=On Windows and Linux, make sure the accelerators still work as expected. On Linux toolkit views, build and run the unit-tests. Review URL: http://codereview.chromium.org/159046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22210 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/event_gtk.cc')
-rw-r--r--views/event_gtk.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/views/event_gtk.cc b/views/event_gtk.cc
index ed55628..d1b9d88 100644
--- a/views/event_gtk.cc
+++ b/views/event_gtk.cc
@@ -8,12 +8,16 @@
namespace views {
-KeyEvent::KeyEvent(GdkEventKey* event)
+// 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_upper_case)
: 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_(event->keyval),
+ character_(make_upper_case ? gdk_keyval_to_upper (event->keyval) :
+ event->keyval),
repeat_count_(0),
message_flags_(0) {
}