Bug 143390 Support handling WM_KEYDOWN during composition r=jmathies, a=joe

This commit is contained in:
Masayuki Nakano 2010-09-15 11:13:12 +09:00
parent 788095452d
commit da189d241a

View File

@ -2121,6 +2121,27 @@ nsIMM32Handler::OnKeyDownEvent(nsWindow* aWindow, WPARAM wParam, LPARAM lParam,
IMEContext.IsValid() && !::ImmGetOpenStatus(IMEContext.get());
}
return PR_FALSE;
case VK_TAB:
case VK_PRIOR:
case VK_NEXT:
case VK_END:
case VK_HOME:
case VK_LEFT:
case VK_UP:
case VK_RIGHT:
case VK_DOWN:
// If IME didn't process the key message (the virtual key code wasn't
// converted to VK_PROCESSKEY), and the virtual key code event causes
// to move caret, we should cancel the composition here. Then, this
// event will be dispatched.
// XXX I think that we should dispatch all key events during composition,
// and nsEditor should cancel/commit the composition if it *thinks*
// it's needed.
if (IsComposingOnOurEditor()) {
// NOTE: We don't need to cancel the composition on another window.
CancelComposition(aWindow, PR_FALSE);
}
return PR_FALSE;
default:
return PR_FALSE;
}