GetKeyState or convert key

Hi, I have a little problem with getkeystate. So I have file with 2 keys in constant format. I read this words in 2 string but I cannot use it in getkeystate(str) or what is the way to convert the key to hexadecimal?

Example of file:
VK_UP
A

1
2
3
4
5
6
...
std::string str;
std::getline(in, str);
...
if(GetKeyState(str) & 0x8000) {
...
GetKeyState function takes an int as a parameter - not a std::string. Recognizing this is where you need to start.
But I have in file keys in word format .. is there any way to convert word to number which matches the format in the command? Is there a feature on this?
Last edited on
Wish I had time to provide an example, but I don't right now. Note GetKeyState is an unusual WinApi function. Most WinApi functions return a success/failure code. GetKeyState returns a number which you must decode using 'masks' to determine the information you want. Study up on AND masks and OR masks.
Topic archived. No new replies allowed.