зеркало из https://github.com/mozilla/pjs.git
bug 153470
Need to process WM_CHAR with (wParam > 0xff) for CJK characters. /r=shanjian; /sr=kin
This commit is contained in:
Родитель
7be79a0d54
Коммит
49a8f28b22
|
@ -2959,19 +2959,28 @@ BOOL nsWindow::OnChar( UINT mbcsCharCode, UINT virtualKeyCode, bool isMultiByte
|
|||
}
|
||||
else
|
||||
{
|
||||
if (mLeadByte) { // mLeadByte is used for keeping the lead-byte of CJK char
|
||||
charToConvert[0] = mLeadByte;
|
||||
charToConvert[1] = LOBYTE(mbcsCharCode);
|
||||
if (!isMultiByte) {
|
||||
if (mLeadByte) { // mLeadByte is used for keeping the lead-byte of CJK char
|
||||
charToConvert[0] = mLeadByte;
|
||||
charToConvert[1] = LOBYTE(mbcsCharCode);
|
||||
mLeadByte = '\0';
|
||||
length=2;
|
||||
}
|
||||
else {
|
||||
charToConvert[0] = LOBYTE(mbcsCharCode);
|
||||
if (::IsDBCSLeadByteEx(gCurrentKeyboardCP, charToConvert[0])) {
|
||||
mLeadByte = charToConvert[0];
|
||||
return TRUE;
|
||||
}
|
||||
length=1;
|
||||
}
|
||||
} else {
|
||||
// SC double-byte punctuation mark in Windows-English is 0x0000aca3
|
||||
uniChar = LOWORD(mbcsCharCode);
|
||||
charToConvert[0] = LOBYTE(uniChar);
|
||||
charToConvert[1] = HIBYTE(uniChar);
|
||||
mLeadByte = '\0';
|
||||
length=2;
|
||||
}
|
||||
else {
|
||||
charToConvert[0] = LOBYTE(mbcsCharCode);
|
||||
if (::IsDBCSLeadByteEx(gCurrentKeyboardCP, charToConvert[0])) {
|
||||
mLeadByte = charToConvert[0];
|
||||
return TRUE;
|
||||
}
|
||||
length=1;
|
||||
}
|
||||
::MultiByteToWideChar(gCurrentKeyboardCP,MB_PRECOMPOSED,charToConvert,length,
|
||||
&uniChar, 1);
|
||||
|
@ -3608,7 +3617,6 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT
|
|||
}
|
||||
|
||||
unsigned char ch = (unsigned char)wParam;
|
||||
UINT char_result;
|
||||
UINT virtualKeyCode;
|
||||
virtualKeyCode = MapVirtualKey(LOBYTE(HIWORD(lParam)), 1);
|
||||
|
||||
|
@ -3628,15 +3636,10 @@ PRBool nsWindow::ProcessMessage(UINT msg, WPARAM wParam, LPARAM lParam, LRESULT
|
|||
//
|
||||
if ((wParam <= 0xff) && (ch==0x0d || ch==0x08)) {
|
||||
|
||||
result = OnChar(ch,ch==0x0d ? VK_RETURN : VK_BACK,true);
|
||||
result = OnChar(wParam, ch==0x0d ? VK_RETURN : VK_BACK, false);
|
||||
break;
|
||||
}
|
||||
|
||||
{
|
||||
char_result = ch;
|
||||
result = OnChar(char_result,ch,false);
|
||||
}
|
||||
|
||||
result = OnChar(wParam, ch, (wParam > 0xff));
|
||||
break;
|
||||
}
|
||||
case WM_SYSKEYUP:
|
||||
|
|
Загрузка…
Ссылка в новой задаче