Hi,
I found a similar thread: How to convert vk_shift value to decimal value?
Please check the document: Virtual-Key Codes
The value of the virtual key is defined by macro. You can use map to bind relationship between CString and decimal value.
#define VK_SHIFT 0x10
std::map<CString, int > vk_key = {
{ (CString)"SHIFT",VK_SHIFT}
};
CString keyvalue = _T("SHIFT");
int vaule = vk_key[keyvalue];
Best regards,
Minxin Yu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.