summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-29 20:47:25 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-29 20:47:25 +0000
commit3d25e9f94dcf5d731241877646a98fea228abe71 (patch)
tree384afd16a95301d700fd4f277f54b1bca1836237 /views
parent858a79c8d042ea5a3101ba37f496f6da8ec2185f (diff)
downloadchromium_src-3d25e9f94dcf5d731241877646a98fea228abe71.zip
chromium_src-3d25e9f94dcf5d731241877646a98fea228abe71.tar.gz
chromium_src-3d25e9f94dcf5d731241877646a98fea228abe71.tar.bz2
Ignore the insert key so we don't switch into overtype mode (which surprises users since there's no indicator of it).
BUG=6856 TEST=In Omnibox or in a native textfield (e.g. the "Add a site" URL field for the Options dialog's "Open these sites at startup" pref), type text, set cursor at beginning, hit insert, and type. Your text should prepend to the existing text instead of replacing it. Review URL: http://codereview.chromium.org/115934 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17231 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/controls/textfield/native_textfield_win.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/views/controls/textfield/native_textfield_win.cc b/views/controls/textfield/native_textfield_win.cc
index 401116c..ff20496 100644
--- a/views/controls/textfield/native_textfield_win.cc
+++ b/views/controls/textfield/native_textfield_win.cc
@@ -420,6 +420,10 @@ void NativeTextfieldWin::OnKeyDown(TCHAR key, UINT repeat_count, UINT flags) {
return;
case VK_INSERT:
+ // Ignore insert by itself, so we don't turn overtype mode on/off.
+ if (!(flags & KF_ALTDOWN) && (GetKeyState(VK_SHIFT) >= 0) &&
+ (GetKeyState(VK_CONTROL) >= 0))
+ return;
case 'V':
if ((flags & KF_ALTDOWN) ||
(GetKeyState((key == 'V') ? VK_CONTROL : VK_SHIFT) >= 0))