--- old/src/windows/native/sun/windows/awt_TextField.cpp 2012-09-06 14:15:18.062299700 +0400 +++ new/src/windows/native/sun/windows/awt_TextField.cpp 2012-09-06 14:15:17.256253600 +0400 @@ -75,6 +75,7 @@ AwtTextField::HandleEvent(MSG *msg, BOOL synthetic) { MsgRouting returnVal; + BOOL systemBeeperEnabled = FALSE; /* * RichEdit 1.0 control starts internal message loop if the * left mouse button is pressed while the cursor is not over @@ -217,6 +218,25 @@ } delete msg; return mrConsume; + } else if (msg->message == WM_KEYDOWN) { + UINT virtualKey = (UINT) msg->wParam; + + switch(virtualKey){ + case VK_RETURN: + case VK_UP: + case VK_DOWN: + case VK_LEFT: + case VK_RIGHT: + case VK_DELETE: + case VK_BACK: + SystemParametersInfo(SPI_GETBEEP, 0, &systemBeeperEnabled, 0); + if(systemBeeperEnabled){ + // disable system beeper for the RICHEDIT control to be compatible + // with the EDIT control behaviour + SystemParametersInfo(SPI_SETBEEP, 0, NULL, 0); + } + break; + } } /* * Store the 'synthetic' parameter so that the WM_PASTE security check @@ -226,6 +246,10 @@ returnVal = AwtComponent::HandleEvent(msg, synthetic); m_synthetic = FALSE; + if(systemBeeperEnabled){ + SystemParametersInfo(SPI_SETBEEP, 1, NULL, 0); + } + return returnVal; }