Bug 1347835 NativeKey should dispatch keypress events even if WM_KEYDOWN is processed by IME but followed by printable WM_(SYS)CHAR messages r=m_kato
Some IME may handle WM_KEYDOWN message before application and may set the keycode value to VK_PROCSSKEY but not do actually. Similarly, IME may handle WM_KEYDOWN message and replace following WM_CHAR messages with different characters. Therefore, even if WM_KEYDOWN message comes with VK_PROCESSKEY, NativeKey shouldn't stop dispatching keypress events if it detects following printable char messages. MozReview-Commit-ID: DcC2qgcLDrQ
This commit is contained in:
@@ -2421,8 +2421,10 @@ NativeKey::HandleKeyDownMessage(bool* aEventDispatched) const
|
||||
|
||||
MOZ_ASSERT(!mWidget->Destroyed());
|
||||
|
||||
// If the key was processed by IME, we shouldn't dispatch keypress event.
|
||||
if (mOriginalVirtualKeyCode == VK_PROCESSKEY) {
|
||||
// If the key was processed by IME and didn't cause WM_(SYS)CHAR messages, we
|
||||
// shouldn't dispatch keypress event.
|
||||
if (mOriginalVirtualKeyCode == VK_PROCESSKEY &&
|
||||
!IsFollowedByPrintableCharOrSysCharMessage()) {
|
||||
MOZ_LOG(sNativeKeyLogger, LogLevel::Info,
|
||||
("%p NativeKey::HandleKeyDownMessage(), not dispatching keypress "
|
||||
"event because the key was already handled by IME, defaultPrevented=%s",
|
||||
|
||||
Reference in New Issue
Block a user