| h4344 (42) | |||
|
Im simply trying to have it so if a user presses for example F1 then the program does whatever i have set in the switch statement. I have very little experience when it comes to working with windows so far and there are pretty much no tutorials that tell you how to do something this simple (yes i actually looked). (This is just an example so if anything is clearly wrong dont be surprised)
I pretty much just need help making this work. | |||
|
Last edited on
|
|||
| soranz (472) | |
It's just a matter of knowing the right term to search for. There are tons of tutorials and there are a few ways to do this. One of them is with GetAsynKeyState(VK_F1);Another way, in windows, is to process the WM_KEYDOWN message. Note that 'VK_F1' by itself is just a number. It only has meaning when it is used as a flag for GetAsynKeyState() or similar function. Search 'how to capture keyboard event c++ tutorial' | |
|
Last edited on
|
|
| h4344 (42) | |
| Ya i saw the GetAsynKeyState before but wasn't sure if it was what i needed. Thanks though ill look into that some more | |
|
|
|
| gabrielsaraiva (27) | |||
Try this:
| |||
|
|
|||