[Webkit-unassigned] [Bug 14331] New: WebKit WNDPROC doesn't catch IME WCHAR message (and more)
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Sat Jun 23 03:23:07 PDT 2007
http://bugs.webkit.org/show_bug.cgi?id=14331
Summary: WebKit WNDPROC doesn't catch IME WCHAR message (and
more)
Product: WebKit
Version: 522+ (nightly)
Platform: PC
OS/Version: Windows XP
Status: UNCONFIRMED
Severity: Enhancement
Priority: P2
Component: WebKit Misc.
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: 808caaa4.8ce9.9cd6c799e9f6 at gmail.com
In Japanese(FE) environment, WebKit/safari cannot accept IME composition
result.
So many users shoud use notepad or something to enter Japanese....
(Type Japanese with notepad, copy to clipboard, and paste to Safari/WebKit)
Windows+IME doesn't obey WM_KEYDOWN - WM_CHAR - WM_KEYUP sequence.
At IME composition startup, WM_KEYDOWN with wParam==VK_PROCESSKEY sent without
proceeding WM_CHAR/WM_KEYUP.
During IME compotision, WM_KEYDOWN without WM_CHAR is sent.
At candidate selection, result is sent by WM_IME_CHAR without
WM_KEYDOWN/WM_KEYUP, and not WM_CHAR.
At IME composition ended, WM_KEYUP without WM_KEYDOWN sent.
Out-of-sequence-WM_KEY-message may takes L"\x0" to text input class,
so sending form content breaks off at that L"\x0" point, as it treated as
cstr-terminating.
I think Apple team now implementing 'Full IME support' with Aqua theme, may be.
Many FE evaluator feels Safari for Windows good and try it widely ASAP.
I wish more nice WM_KEY/WM_CHAR handling model in WebViewWndProc implementation
for FE envilonment.
Below is sample implementation. Works almost well with floating composition
window.
...works very well, nice experience.
volatile LONG cIMEComposition=0;
volatile LONG cWMKeyMessagesPassThruTicketCount=0;
volatile LONG cWMKeyDownMessagesCountForCheckingPair=0;
LRESULT CALLBACK MyWebVwWndProcW(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM
lParam)
{
switch(uMsg){
case WM_IME_STARTCOMPOSITION:
cIMEComposition++;
break;
case WM_IME_ENDCOMPOSITION:
cIMEComposition--;
if(cIMEComposition<0) cIMEComposition=0;
cWMKeyDownMessagesCountForCheckingPair=0;
break;
case WM_IME_CHAR:
cWMKeyMessagesPassThruTicketCount+=2; // 2 times... WM_KEYDOWN
and WM_KEYUP
PostMessageW(hwnd, WM_KEYDOWN, wParam, lParam);
PostMessageW(hwnd, WM_CHAR, wParam, lParam);
PostMessageW(hwnd, WM_KEYUP, wParam, lParam | 0xc0000000);
return 0;
case WM_KEYUP:
if(!cWMKeyDownMessagesCountForCheckingPair) break; // bypass
NOT paired with WM_KEYDOWN
cWMKeyDownMessagesCountForCheckingPair--;
if(cWMKeyDownMessagesCountForCheckingPair<0)
cWMKeyDownMessagesCountForCheckingPair=0;
goto L1;
case WM_KEYDOWN:
if(wParam==VK_PROCESSKEY) break;
cWMKeyDownMessagesCountForCheckingPair++;
// -----
L1:
if(cIMEComposition) {
// NOT bypass WM_KEY* from WM_IME_CHAR above
// with this demo code, suppose WM_KEY* reach very soon
after PostMessageW above
if(cWMKeyMessagesPassThruTicketCount){
cWMKeyMessagesPassThruTicketCount--;
if(cWMKeyMessagesPassThruTicketCount<0)
cWMKeyMessagesPassThruTicketCount=0;
// thru
} else {
break;
}
}
// NOT IME composition mode, pass to WebVwWndProcW
default:
return WebVwWndProcW(hwnd,uMsg,wParam,lParam);
}
return DefWindowProcW(hwnd, uMsg, wParam, lParam);
}
--
Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the webkit-unassigned
mailing list