diff --git a/widget/windows/KeyboardLayout.cpp b/widget/windows/KeyboardLayout.cpp index 3f23033a36d3..03b72f9ba0b7 100644 --- a/widget/windows/KeyboardLayout.cpp +++ b/widget/windows/KeyboardLayout.cpp @@ -1367,9 +1367,14 @@ NativeKey::GetFollowingCharMessage(MSG& aCharMsg) const continue; } + // NOTE: Although, we don't know when this case occurs, the scan code value + // in lParam may be changed from 0 to something. The changed value + // is different from the scan code of handling keydown message. + static const LPARAM kScanCodeMask = 0x00FF0000; if (removedMsg.message != nextKeyMsg.message || removedMsg.wParam != nextKeyMsg.wParam || - removedMsg.lParam != nextKeyMsg.lParam) { + (removedMsg.lParam & ~kScanCodeMask) != + (nextKeyMsg.lParam & ~kScanCodeMask)) { #ifdef MOZ_CRASHREPORTER nsPrintfCString info("\nHandling message: %s (0x%08X), wParam: 0x%08X, " "lParam: 0x%08X, InSendMessageEx()=%s, \n"