windows widget code handles control-key combinations correctly.


git-svn-id: svn://10.0.0.236/trunk@50974 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
buster%netscape.com
1999-10-18 03:39:48 +00:00
parent 8013d6bb78
commit 7653742295

View File

@@ -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);