1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-17 18:59:09 +00:00
It seems that silly Adam was storing a UINT scan code because MapVirtualKey
wanted a UINT. However, WM_CHAR only has a BYTE scan code in its lParam.
Therefore, we got garbage on repeated key events, which bungled up the key
binding parser.
This commit is contained in:
2011-10-20 18:34:19 -04:00
parent e616874a07
commit 6582d0261e

View File

@ -281,15 +281,14 @@ void plInputManager::HandleWin32ControlEvent(UINT message, WPARAM Wparam, LPARAM
Wparam == KEY_TAB || Wparam == 0x0D) Wparam == KEY_TAB || Wparam == 0x0D)
break; break;
UINT scan = Lparam >> 16; BYTE scan = Lparam >> 16;
scan = MapVirtualKeyEx(scan, MAPVK_VSC_TO_VK, nil); UINT vkey = MapVirtualKey(scan, MAPVK_VSC_TO_VK);
if (scan == 0) scan = -1;
bExtended = Lparam >> 24 & 1; bExtended = Lparam >> 24 & 1;
hsBool bRepeat = ((Lparam >> 29) & 0xf) != 0; hsBool bRepeat = ((Lparam >> 29) & 0xf) != 0;
bool down = !(Lparam >> 31); bool down = !(Lparam >> 31);
for (int i=0; i<fInputDevices.Count(); i++) for (int i=0; i<fInputDevices.Count(); i++)
fInputDevices[i]->HandleKeyEvent( CHAR_MSG, (plKeyDef)scan, down, bRepeat, (wchar_t)Wparam ); fInputDevices[i]->HandleKeyEvent( CHAR_MSG, (plKeyDef)vkey, down, bRepeat, (wchar_t)Wparam );
} }
break; break;
case MOUSEWHEEL: case MOUSEWHEEL: