How do I handle key presses and key up events in the windows message loop? I need to be able to call two functions OnKeyUp(char c); and OnKeyDown(char c);.
Current literature I’ve found from googling has lead me to confusion over WM_CHAR or WM_KEYUP and WM_KEYDOWN, and is normally targeted at PDA or Managed code, whereas I’m using C++.
Use
char c = MapVirtualKey(param,MAPVK_VK_TO_CHAR);to convert virtual key codes to char, and process WM_KEYUP and WM_KEYDOWN and their wParams.