Enable TranslateMessage again for external Windows. Something Strong99 requested in an old forum post (http://irrlicht.sourceforge.net/forum/viewtopic.php?f=7&t=44918&p=257786)

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@4742 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2014-03-28 16:05:52 +00:00
parent 6025e9026c
commit 13b42f6581
1 changed files with 16 additions and 5 deletions

View File

@ -797,7 +797,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
// Handle unicode and deadkeys in a way that works since Windows 95 and nt4.0
// Using ToUnicode instead would be shorter, but would to my knowledge not run on 95 and 98.
WORD keyChars[2];
UINT scanCode = HIWORD(lParam) & 0x7FFF;
UINT scanCode = HIWORD(lParam);
int conversionResult = ToAsciiEx(wParam,scanCode,allKeys,keyChars,0,KEYBOARD_INPUT_HKL);
if (conversionResult == 1)
{
@ -1835,13 +1835,24 @@ void CIrrDeviceWin32::handleSystemMessages()
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
// No message translation because we don't use WM_CHAR and it would conflict with our
// deadkey handling.
if (ExternalWindow && msg.hwnd == HWnd)
WndProc(HWnd, msg.message, msg.wParam, msg.lParam);
{
if (msg.hwnd == HWnd)
{
WndProc(HWnd, msg.message, msg.wParam, msg.lParam);
}
else
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
else
{
// No message translation because we don't use WM_CHAR and it would conflict with our
// deadkey handling.
DispatchMessage(&msg);
}
if (msg.message == WM_QUIT)
Close = true;