<ctrl>= no generates the correct key code on up and down and is not filtered out

as double byte on press.
r=brade b=5716
This commit is contained in:
rods%netscape.com 2000-02-02 15:00:59 +00:00
parent 2739f5a184
commit cd2e9f17fe
2 changed files with 19 additions and 7 deletions

View File

@ -1829,6 +1829,17 @@ NS_METHOD nsWindow::EnableDragDrop(PRBool aEnable)
return rv;
}
//-------------------------------------------------------------------------
UINT nsWindow::MapFromNativeToDOM(UINT aNativeKeyCode)
{
if (aNativeKeyCode == 0xBB) { // equals
return 0x3D;
} else if (aNativeKeyCode == 0xBA) { // semicolon
return 0x3B;
}
return aNativeKeyCode;
}
//-------------------------------------------------------------------------
//
@ -1846,7 +1857,7 @@ PRBool nsWindow::DispatchKeyEvent(PRUint32 aEventType, WORD aCharCode, UINT aVir
InitEvent(event, aEventType, &point); // this add ref's event.widget
event.charCode = aCharCode;
event.keyCode = aVirtualCharCode;
event.keyCode = !mIMEIsComposing?MapFromNativeToDOM(aVirtualCharCode):aVirtualCharCode;
#ifdef KE_DEBUG
static cnt=0;
@ -2064,8 +2075,8 @@ BOOL nsWindow::OnChar( UINT mbcsCharCode, UINT virtualKeyCode, bool isMultiByte
virtualKeyCode = 0;
}
else
{
if(virtualKeyCode < 0x20)
{ // 0x20 - SPACE, 0x3D - EQUALS
if(virtualKeyCode < 0x20 || virtualKeyCode == 0x3D)
{
uniChar = 0;
}

View File

@ -195,6 +195,7 @@ protected:
BOOL OnKeyDown( UINT aVirtualKeyCode, UINT aScanCode);
BOOL OnKeyUp( UINT aVirtualKeyCode, UINT aScanCode);
UINT MapFromNativeToDOM(UINT aNativeKeyCode);
BOOL OnInputLangChange(HKL aHKL, LRESULT *oResult);
@ -231,10 +232,10 @@ protected:
void RelayMouseEvent(UINT aMsg, WPARAM wParam, LPARAM lParam);
void GetNonClientBounds(nsRect &aRect);
void HandleTextEvent(HIMC hIMEContext, PRBool aCheckAttr=PR_TRUE);
void HandleStartComposition(HIMC hIMEContext);
void HandleEndComposition(void);
void MapDBCSAtrributeArrayToUnicodeOffsets(PRUint32* textRangeListLengthResult, nsTextRangeArray* textRangeListResult);
void HandleTextEvent(HIMC hIMEContext, PRBool aCheckAttr=PR_TRUE);
void HandleStartComposition(HIMC hIMEContext);
void HandleEndComposition(void);
void MapDBCSAtrributeArrayToUnicodeOffsets(PRUint32* textRangeListLengthResult, nsTextRangeArray* textRangeListResult);
NS_IMETHOD PasswordFieldEnter(PRUint32& oSavedState);
NS_IMETHOD PasswordFieldExit(PRUint32 aRestoredState);