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

Unified Diff: views/events/event_win.cc

Issue 6713027: Add GetCharacter() and GetUnmodifiedCharacter() methods to views::Event. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update comment. Created 9 years, 9 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/events/event_unittest.cc ('k') | views/events/event_x.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/events/event_win.cc
diff --git a/views/events/event_win.cc b/views/events/event_win.cc
index 11f63ec3e2affa91ec125e6a85fd27527d598674..ad19185c11459321cb253fbdc60f6d50b8610e94 100644
--- a/views/events/event_win.cc
+++ b/views/events/event_win.cc
@@ -217,6 +217,17 @@ KeyEvent::KeyEvent(NativeEvent2 native_event_2, FromNativeEvent2 from_native)
NOTREACHED();
}
+uint16 KeyEvent::GetCharacter() const {
+ return (native_event().message == WM_CHAR) ? key_code_ :
+ GetCharacterFromKeyCode(key_code_, flags());
+}
+
+uint16 KeyEvent::GetUnmodifiedCharacter() const {
+ // Looks like there is no way to get unmodified character on Windows.
+ return (native_event().message == WM_CHAR) ? key_code_ :
+ GetCharacterFromKeyCode(key_code_, flags() & ui::EF_SHIFT_DOWN);
+}
+
////////////////////////////////////////////////////////////////////////////////
// MouseEvent, public:
« no previous file with comments | « views/events/event_unittest.cc ('k') | views/events/event_x.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698