From 7aea3964f54809b92fdc82ed08b0a7644fd2e345 Mon Sep 17 00:00:00 2001 From: crs Date: Wed, 29 Dec 2004 21:10:49 +0000 Subject: [PATCH] Fixed handling of number pad number and decimal point keys when NumLock is on on client on windows 95 family. --- lib/platform/CMSWindowsKeyState.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/platform/CMSWindowsKeyState.cpp b/lib/platform/CMSWindowsKeyState.cpp index 50f810e7..67cae68a 100644 --- a/lib/platform/CMSWindowsKeyState.cpp +++ b/lib/platform/CMSWindowsKeyState.cpp @@ -1404,9 +1404,14 @@ CMSWindowsKeyState::mapVirtKeyToButton(UINT virtualKey, // doesn't make any sense since a button can't actually generate // 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 - // point. - if (button == 0 || MapVirtualKey(button, 1) != virtualKey) { - return 0; + // 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) { + return 0; + } } break; }