Fix XP build

develop
kaetemi 4 years ago
parent 856f7e88f2
commit 2450f95c03

@ -1265,9 +1265,11 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
return 0; return 0;
} }
#ifdef WM_UNICHAR
// https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-unichar // https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-unichar
if (message == WM_UNICHAR) if (message == WM_UNICHAR)
return (wParam == UNICODE_NOCHAR); return (wParam == UNICODE_NOCHAR);
#endif
return DefWindowProcW(hWnd, message, wParam, lParam); return DefWindowProcW(hWnd, message, wParam, lParam);
} }

@ -183,9 +183,11 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
return 0; return 0;
} }
#ifdef WM_UNICHAR
// https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-unichar // https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-unichar
if (message == WM_UNICHAR) if (message == WM_UNICHAR)
return (wParam == UNICODE_NOCHAR); return (wParam == UNICODE_NOCHAR);
#endif
return trapMessage ? 0 : DefWindowProcW(hWnd, message, wParam, lParam); return trapMessage ? 0 : DefWindowProcW(hWnd, message, wParam, lParam);
} }

@ -459,9 +459,11 @@ namespace NLMISC
{ {
return handleWMCopyData(hwnd, (COPYDATASTRUCT *) lParam); return handleWMCopyData(hwnd, (COPYDATASTRUCT *) lParam);
} }
#ifdef WM_UNICHAR
// https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-unichar // https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-unichar
if (uMsg == WM_UNICHAR) if (uMsg == WM_UNICHAR)
return (wParam == UNICODE_NOCHAR); return (wParam == UNICODE_NOCHAR);
#endif
return DefWindowProc(hwnd, uMsg, wParam, lParam); return DefWindowProc(hwnd, uMsg, wParam, lParam);
} }

@ -162,6 +162,7 @@ bool CWinEventEmitter::processMessage (HWND hWnd, uint32 msg, WPARAM wParam, LPA
server->postEvent (new CEventKeyUp ((NLMISC::TKey)wParam, getKeyButton(_AltButton, _ShiftButton, _CtrlButton), this)); server->postEvent (new CEventKeyUp ((NLMISC::TKey)wParam, getKeyButton(_AltButton, _ShiftButton, _CtrlButton), this));
} }
break; break;
#ifdef WM_UNICHAR
case WM_UNICHAR: case WM_UNICHAR:
if (wParam != UNICODE_NOCHAR && _KeyboardEventsEnabled) if (wParam != UNICODE_NOCHAR && _KeyboardEventsEnabled)
{ {
@ -170,11 +171,15 @@ bool CWinEventEmitter::processMessage (HWND hWnd, uint32 msg, WPARAM wParam, LPA
server->postEvent (new CEventChar ((u32char)wParam, getKeyButton(_AltButton, _ShiftButton, _CtrlButton), this)); server->postEvent (new CEventChar ((u32char)wParam, getKeyButton(_AltButton, _ShiftButton, _CtrlButton), this));
} }
break; break;
#endif
case WM_CHAR: case WM_CHAR:
if (_KeyboardEventsEnabled) if (_KeyboardEventsEnabled)
{ {
//if (wParam < KeyCount) //if (wParam < KeyCount)
//nlinfo("WM_CHAR with %u", wParam); //nlinfo("WM_CHAR with %u", wParam);
#ifndef WM_UNICHAR
// FIXME: Combine UTF-16 pairs
#endif
server->postEvent (new CEventChar ((ucchar)wParam, getKeyButton(_AltButton, _ShiftButton, _CtrlButton), this)); server->postEvent (new CEventChar ((ucchar)wParam, getKeyButton(_AltButton, _ShiftButton, _CtrlButton), this));
} }
break; break;

Loading…
Cancel
Save