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

Unified Diff: views/event_gtk.cc

Issue 159046: Implementing accelerators for Linux toolkit_views (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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 | « views/event.h ('k') | views/focus/accelerator_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/event_gtk.cc
===================================================================
--- views/event_gtk.cc (revision 22100)
+++ views/event_gtk.cc (working copy)
@@ -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) {
}
Property changes on: views/event_gtk.cc
___________________________________________________________________
Name: svn:eol-style
+ LF
« no previous file with comments | « views/event.h ('k') | views/focus/accelerator_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698