[Webkit-unassigned] [Bug 204672] [Win] 'key' property of keydown KeyboardEvent doesn't have the diacritic for alphabet key following a dead key
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Nov 28 03:10:21 PST 2019
https://bugs.webkit.org/show_bug.cgi?id=204672
--- Comment #1 from Fujii Hironori <Hironori.Fujii at sony.com> ---
In Chromium, InputMethodWinBase::DispatchKeyEvent retrieves queued WM_CHAR events, and sets a char information from WM_CHAR to the keydown event.
> std::vector<MSG> char_msgs;
> // Combines the WM_KEY* and WM_CHAR messages in the event processing flow
> // which is necessary to let Chrome IME extension to process the key event
> // and perform corresponding IME actions.
> // Chrome IME extension may wants to consume certain key events based on
> // the character information of WM_CHAR messages. Holding WM_KEY* messages
> // until WM_CHAR is processed by the IME extension is not feasible because
> // there is no way to know whether there will or not be a WM_CHAR following
> // the WM_KEY*.
> // Chrome never handles dead chars so it is safe to remove/ignore
> // WM_*DEADCHAR messages.
> MSG msg;
> while (::PeekMessage(&msg, native_key_event.hwnd, WM_CHAR, WM_DEADCHAR,
> PM_REMOVE)) {
> if (msg.message == WM_CHAR)
> char_msgs.push_back(msg);
> }
> while (::PeekMessage(&msg, native_key_event.hwnd, WM_SYSCHAR, WM_SYSDEADCHAR,
> PM_REMOVE)) {
> if (msg.message == WM_SYSCHAR)
> char_msgs.push_back(msg);
> }
(...)
> // If only 1 WM_CHAR per the key event, set it as the character of it.
> if (char_msgs.size() == 1 &&
> !std::iswcntrl(static_cast<wint_t>(char_msgs[0].wParam)))
> event->set_character(static_cast<base::char16>(char_msgs[0].wParam));
https://cs.chromium.org/chromium/src/ui/base/ime/win/input_method_win_base.cc?type=cs&q=InputMethodWinBase::DispatchKeyEvent&sq=package:chromium&g=0&l=193
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20191128/7ae1e5e9/attachment.htm>
More information about the webkit-unassigned
mailing list