зеркало из https://github.com/mozilla/pjs.git
Bug 314130 input numbers twice when using Unispim IME at chinese input mode r=ere, sr=roc
This commit is contained in:
Родитель
93e89a4058
Коммит
cce1d49d68
|
@ -220,6 +220,15 @@ PRBool KeyboardLayout::IsPrintableCharKey (PRUint8 aVirtualKey)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PRBool KeyboardLayout::IsNumpadKey (PRUint8 aVirtualKey)
|
||||||
|
{
|
||||||
|
#ifndef WINCE
|
||||||
|
return VK_NUMPAD0 <= aVirtualKey && aVirtualKey <= VK_DIVIDE;
|
||||||
|
#else
|
||||||
|
return PR_FALSE;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void KeyboardLayout::OnKeyDown (PRUint8 aVirtualKey)
|
void KeyboardLayout::OnKeyDown (PRUint8 aVirtualKey)
|
||||||
{
|
{
|
||||||
#ifndef WINCE
|
#ifndef WINCE
|
||||||
|
|
|
@ -176,6 +176,7 @@ public:
|
||||||
~KeyboardLayout ();
|
~KeyboardLayout ();
|
||||||
|
|
||||||
static PRBool IsPrintableCharKey (PRUint8 aVirtualKey);
|
static PRBool IsPrintableCharKey (PRUint8 aVirtualKey);
|
||||||
|
static PRBool IsNumpadKey (PRUint8 aVirtualKey);
|
||||||
|
|
||||||
PRBool IsDeadKey () const
|
PRBool IsDeadKey () const
|
||||||
{
|
{
|
||||||
|
|
|
@ -3404,7 +3404,9 @@ BOOL nsWindow::OnKeyDown(UINT aVirtualKeyCode, UINT aScanCode, LPARAM aKeyData)
|
||||||
#endif
|
#endif
|
||||||
return OnChar(msg.wParam, extraFlags);
|
return OnChar(msg.wParam, extraFlags);
|
||||||
} else if (!mIsControlDown && !mIsAltDown &&
|
} else if (!mIsControlDown && !mIsAltDown &&
|
||||||
KeyboardLayout::IsPrintableCharKey(aVirtualKeyCode)) {
|
(KeyboardLayout::IsPrintableCharKey(aVirtualKeyCode) ||
|
||||||
|
KeyboardLayout::IsNumpadKey(aVirtualKeyCode)))
|
||||||
|
{
|
||||||
// If this is simple KeyDown event but next message is not WM_CHAR,
|
// If this is simple KeyDown event but next message is not WM_CHAR,
|
||||||
// this event may not input text, so we should ignore this event.
|
// this event may not input text, so we should ignore this event.
|
||||||
// See bug 314130.
|
// See bug 314130.
|
||||||
|
|
Загрузка…
Ссылка в новой задаче