From 7653742295ce869ec357886fe70724e9e0ea2bf7 Mon Sep 17 00:00:00 2001 From: "buster%netscape.com" Date: Mon, 18 Oct 1999 03:39:48 +0000 Subject: [PATCH] fixed bug 16486, r=brade@netscape.com windows widget code handles control-key combinations correctly. git-svn-id: svn://10.0.0.236/trunk@50974 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/widget/src/windows/nsWindow.cpp | 28 +++++++++++++++---------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/mozilla/widget/src/windows/nsWindow.cpp b/mozilla/widget/src/windows/nsWindow.cpp index f475a6966c6..979db13a6e0 100644 --- a/mozilla/widget/src/windows/nsWindow.cpp +++ b/mozilla/widget/src/windows/nsWindow.cpp @@ -2331,20 +2331,26 @@ BOOL nsWindow::OnChar( UINT mbcsCharCode, UINT virtualKeyCode, bool isMultiByte if(mIsControlDown && (virtualKeyCode <= 0x1A)) // Ctrl+A Ctrl+Z, see Programming Windows 3.1 page 110 for details { - uniChar = virtualKeyCode - 1 + NS_VK_A ; - virtualKeyCode = 0; - } - else - if(virtualKeyCode < 0x20) - { - uniChar = 0; + // need to account for shift here. bug 16486 + if ( mIsShiftDown ) + uniChar = virtualKeyCode - 1 + 'A' ; + else + uniChar = virtualKeyCode - 1 + 'a' ; + virtualKeyCode = 0; } else { - ::MultiByteToWideChar(mCurrentKeyboardCP,MB_PRECOMPOSED,charToConvert,length, - &uniChar,sizeof(uniChar)); - virtualKeyCode = 0; - mIsShiftDown = PR_FALSE; + if(virtualKeyCode < 0x20) + { + uniChar = 0; + } + else + { + ::MultiByteToWideChar(mCurrentKeyboardCP,MB_PRECOMPOSED,charToConvert,length, + &uniChar,sizeof(uniChar)); + virtualKeyCode = 0; + mIsShiftDown = PR_FALSE; + } } return DispatchKeyEvent(NS_KEY_PRESS, uniChar, virtualKeyCode);