From cf2d9778f34c805813b22258ec602af9862c7e40 Mon Sep 17 00:00:00 2001 From: Masayuki Nakano Date: Tue, 18 Feb 2014 21:42:04 +0900 Subject: [PATCH] Bug 962140 NativeKey should not check scan code at comparing found char message and removed char message r=jimm --- widget/windows/KeyboardLayout.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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"