   Windows: Name of key codes
  Hi all!Is there any way to find out the name of a key? For example.. if I run a function on key 32 it would return "space" (or similar) and if I run it on the coed for "LALT" it would return "left alt" (or similar).Or do I have to create my own table for this, and localize it for each language (horrible work to do, but if there is no better way...)?   
  I can't recall if I've ever used this method, but a brief search on the MSDN brought up this: GetKeyNameText#include <iostream>#include <string>#include <windows.h>#include <windowsx.h>using namespace std;wstring getKeyText(unsigned int vKey){    WCHAR buf[256];    unsigned int scanCode = MapVirtualKey(vKey, 0) << 16;    GetKeyNameText(scanCode, buf, 256);    return wstring(buf);}int main(){    wcout << getKeyText(VK_RETURN) << endl;} [Edited by - CaspianB on April 13, 2010 8:21:44 AM];  Super! Thank you :) Honestly, did not manage to come up with any good search query... my logic sucks today. Cheers!   ;  Is it possible to do the same for mouse buttons by any chance?   ;  Just noticed that trying to get the name of VK_UP returns "NUM 8" and not "UP".. Any suggestion why this is happening?   ;  I'm not sure if there's a way to do it for mouse buttons...I believe the oddities you are getting is due to the extended-key code bit which is bit 24 on the passed in scan code. If you look at the numpad, then "Num 8" Is the Up arrow.If you modify the scanCode value like this to set the bit you will get the correct name when passing in VK_PRIOR or VK_UP... scanCode |= 0x01000000;However, I do not think you always want that bit set. For example, if that bit is set and you pass in VK_RETURN you get "Num Enter" back instead of just "Enter" or if you pass in VK_F1 you get nothing back... So you'll probably need to add some code to check if it should be set or not.It looks like there might be an example of this here...http://www.ffuts.org/blog/mapvirtualkey-getkeynametext-and-a-story-of-how-to/   ;  Thanks, much appreciated! :)   