Commit 3d25e9f9 authored by pkasting@chromium.org's avatar pkasting@chromium.org

Ignore the insert key so we don't switch into overtype mode (which surprises...

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
parent 858a79c8
...@@ -1729,6 +1729,11 @@ bool AutocompleteEditViewWin::OnKeyDownOnlyWritable(TCHAR key, ...@@ -1729,6 +1729,11 @@ bool AutocompleteEditViewWin::OnKeyDownOnlyWritable(TCHAR key,
return true; return true;
case VK_INSERT: 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 true;
// FALL THROUGH
case 'V': case 'V':
if ((flags & KF_ALTDOWN) || if ((flags & KF_ALTDOWN) ||
(GetKeyState((key == 'V') ? VK_CONTROL : VK_SHIFT) >= 0)) (GetKeyState((key == 'V') ? VK_CONTROL : VK_SHIFT) >= 0))
......
...@@ -420,6 +420,10 @@ void NativeTextfieldWin::OnKeyDown(TCHAR key, UINT repeat_count, UINT flags) { ...@@ -420,6 +420,10 @@ void NativeTextfieldWin::OnKeyDown(TCHAR key, UINT repeat_count, UINT flags) {
return; return;
case VK_INSERT: 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': case 'V':
if ((flags & KF_ALTDOWN) || if ((flags & KF_ALTDOWN) ||
(GetKeyState((key == 'V') ? VK_CONTROL : VK_SHIFT) >= 0)) (GetKeyState((key == 'V') ? VK_CONTROL : VK_SHIFT) >= 0))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment