Fixed handling of number pad number and decimal point keys when

NumLock is on on client on windows 95 family.
This commit is contained in:
crs 2004-12-29 21:10:49 +00:00
parent d70ad662bf
commit 7aea3964f5
1 changed files with 8 additions and 3 deletions

View File

@ -1404,10 +1404,15 @@ CMSWindowsKeyState::mapVirtKeyToButton(UINT virtualKey,
// doesn't make any sense since a button can't actually generate // doesn't make any sense since a button can't actually generate
// more than one virtual key. to avoid this stupidity, we map the // more than one virtual key. to avoid this stupidity, we map the
// button back to a virtual key to see if it matches the starting // button back to a virtual key to see if it matches the starting
// point. // point. we don't do this for number pad keys since we expect
// each key to generate one of two virtual keys, depending on the
// state of NumLock, a state we can't pass to MapVirtualKey.
if ((virtualKey < VK_NUMPAD0 || virtualKey > VK_NUMPAD9) &&
virtualKey != VK_SEPARATOR && virtualKey != VK_DECIMAL) {
if (button == 0 || MapVirtualKey(button, 1) != virtualKey) { if (button == 0 || MapVirtualKey(button, 1) != virtualKey) {
return 0; return 0;
} }
}
break; break;
} }
} }