diff --git a/widget/src/windows/nsWindow.cpp b/widget/src/windows/nsWindow.cpp index 60bb480f6986..3bc10bb111e2 100644 --- a/widget/src/windows/nsWindow.cpp +++ b/widget/src/windows/nsWindow.cpp @@ -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; } diff --git a/widget/src/windows/nsWindow.h b/widget/src/windows/nsWindow.h index 0be3f0464acc..d3b2551605b3 100644 --- a/widget/src/windows/nsWindow.h +++ b/widget/src/windows/nsWindow.h @@ -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);