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

Unified Diff: views/controls/textfield/native_textfield_views.cc

Issue 6068005: views: Fix shifted keyevents in textfield. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Remove default arg Created 9 years, 12 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 | « no previous file | views/controls/textfield/native_textfield_views_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/textfield/native_textfield_views.cc
diff --git a/views/controls/textfield/native_textfield_views.cc b/views/controls/textfield/native_textfield_views.cc
index b7c01f81c9abe4f86348799546cde8ee7ec7941e..00005ae8539aa886e56806e0ee0a75c5bc065c57 100644
--- a/views/controls/textfield/native_textfield_views.cc
+++ b/views/controls/textfield/native_textfield_views.cc
@@ -484,7 +484,8 @@ char16 NativeTextfieldViews::GetPrintableChar(const KeyEvent& key_event) {
// TODO(oshima): IME, i18n support.
// This only works for UCS-2 characters.
app::KeyboardCode key_code = key_event.GetKeyCode();
- bool shift = key_event.IsShiftDown() ^ key_event.IsCapsLockDown();
+ bool shift = key_event.IsShiftDown();
+ bool upper = shift ^ key_event.IsCapsLockDown();
// TODO(oshima): We should have a utility function
// under app to convert a KeyboardCode to a printable character,
// probably in keyboard_code_conversion{.h, _x
@@ -568,7 +569,7 @@ char16 NativeTextfieldViews::GetPrintableChar(const KeyEvent& key_event) {
case app::VKEY_X:
case app::VKEY_Y:
case app::VKEY_Z:
- return (shift ? 'A' : 'a') + (key_code - app::VKEY_A);
+ return (upper ? 'A' : 'a') + (key_code - app::VKEY_A);
case app::VKEY_OEM_1:
return shift ? ':' : ';';
case app::VKEY_OEM_PLUS:
« no previous file with comments | « no previous file | views/controls/textfield/native_textfield_views_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698