Commit 13b42f65 authored by cutealien's avatar cutealien

Enable TranslateMessage again for external Windows. Something Strong99...

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
parent 6025e902
...@@ -797,7 +797,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) ...@@ -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 // 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. // Using ToUnicode instead would be shorter, but would to my knowledge not run on 95 and 98.
WORD keyChars[2]; WORD keyChars[2];
UINT scanCode = HIWORD(lParam) & 0x7FFF; UINT scanCode = HIWORD(lParam);
int conversionResult = ToAsciiEx(wParam,scanCode,allKeys,keyChars,0,KEYBOARD_INPUT_HKL); int conversionResult = ToAsciiEx(wParam,scanCode,allKeys,keyChars,0,KEYBOARD_INPUT_HKL);
if (conversionResult == 1) if (conversionResult == 1)
{ {
...@@ -1835,13 +1835,24 @@ void CIrrDeviceWin32::handleSystemMessages() ...@@ -1835,13 +1835,24 @@ void CIrrDeviceWin32::handleSystemMessages()
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) 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) 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 else
{
// No message translation because we don't use WM_CHAR and it would conflict with our
// deadkey handling.
DispatchMessage(&msg); DispatchMessage(&msg);
}
if (msg.message == WM_QUIT) if (msg.message == WM_QUIT)
Close = true; Close = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment