Is there a way to translate a character to its corresponding hardware scan code (not the virtual key code)? I need that to communicate with ancient hardware device.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Seems the most direct method would be to use MapVirtualKey or MapVirtualKeyEx which translates from VK-codes to Scan codes.
The character to VK scan code can be gotten using VkKeyScan (extracting the low byte which contains the VK Code according to MS documentation). So to get the scan code of ‘X’: