win32: differentiate between left and right special keys

This commit is contained in:
OV2 2016-11-04 00:02:27 +01:00
parent 09df5e1406
commit 1fb5d790e3
1 changed files with 28 additions and 9 deletions

View File

@ -959,6 +959,24 @@ static LRESULT CALLBACK InputCustomWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
return 1;
case WM_USER+45:
case WM_KEYDOWN:
{
UINT scancode = (lParam & 0x00ff0000) >> 16;
int extended = (lParam & 0x01000000) != 0;
switch (wParam) {
case VK_SHIFT:
wParam = MapVirtualKey(scancode, MAPVK_VSC_TO_VK_EX);
break;
case VK_CONTROL:
wParam = extended ? VK_RCONTROL : VK_LCONTROL;
break;
case VK_MENU:
wParam = extended ? VK_RMENU : VK_LMENU;
break;
default:
break;
}
TranslateKey(wParam, temp);
col = CheckButtonKey(wParam);
@ -970,6 +988,7 @@ static LRESULT CALLBACK InputCustomWndProc(HWND hwnd, UINT msg, WPARAM wParam, L
SendMessage(pappy, WM_USER + 43, wParam, (LPARAM)hwnd);
break;
}
case WM_USER+44:
TranslateKey(wParam,temp);