我怎么确定某个字符 char ch; 对应着键盘上的哪个键? ch 与 键的 VK_CODE之间怎么对应?
因为我要通过 key_event来将这个字符输出来!

解决方案 »

  1.   

    http://community.csdn.net/Expert/topic/4666/4666813.xml?temp=.2292749
      

  2.   

    也可以看这里:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/userinput/virtualkeycodes.asp
    上面URL中MSDN给出了所有按键的ASCII码。
      

  3.   

    左右中括号对应的那两个键的 Virtual-Key Codes  是多少? 另外,是不是各种语言的键盘布局是一样的?比如数字键上面的那一排字符是不是在各种语言的键盘上都是这么设置的?
      

  4.   

    VK_OEM_4 (DB)
    Used for miscellaneous characters; it can vary by keyboard. 
    Windows 2000/XP: For the US standard keyboard, the '[{' key
    VK_OEM_5 (DC)
    Used for miscellaneous characters; it can vary by keyboard. 
    Windows 2000/XP: For the US standard keyboard, the '\|' key
    VK_OEM_6 (DD)
    Used for miscellaneous characters; it can vary by keyboard. 
    Windows 2000/XP: For the US standard keyboard, the ']}' key
      

  5.   

    是不是各种语言的键盘布局是一样的?比如数字键上面的那一排字符是不是在各种语言的键盘上都是这么设置的?
    ------------------------------------------------------------------------------------
    微软的Visual Studio开发平台中是一样的,其他语言平台没接触过,只能保证ASCII码在127以下是一样的,其他的自己试试吧。