Hi everyone,
So I have a question that is probably a bit basic, but I'm having a slight issue with the OnKeyDown event. I want to be able to detect the user pressing buttons on the numeric keypad. The problem is, if Num Lock is turned off, it will register the buttons as if other keys were pressed (e.g. 1 on the keypad is the same as "End", and the virtual key code will be VK_END rather than VK_NUMPAD1). Is there a way to be certain as to what key is pressed regardless of the state of Num Lock. I know I could easily hook into the WM_KEYDOWN message and evaluate the keyboard scan code, but I rather not do that because it will break portability and scan codes are platform-specific.
ADDENDUM: I'm sensing there may be no way around this except to either evaluate the keyboard scan code, or force Num Lock to be turned on (which might be a little risky if the user normally likes it turned off).