I made an account to get help here. I'm new to programming (in c++).
I was wondering if there is a way to make a program wait for a specific key press, while ignoring all other key presses until the key I have selected is pressed.
For example, I'm doing a countdown timer program that counts from 30 down to 0, and I would like for it to reset automatically when I press the "v" key. So it would ignore other random key presses until "v" is pressed. Also, it must be doable without having to hit enter as well preferably.
I am using Windows 7. I've sort of figured out how to make it ignore other key presses, but now my biggest problem is trying to get it to accept the input without the user having to hit enter.
Anyone know how to make it to where the program can accept input without having to hit enter?
Thanks.
EDIT: Also, if you meant that I could accomplish this using the virtual keys, could you explain how I could do this? I've never heard of that before. I'm a noob.
You might be better asking in the windows programming section about this, because what you want to accomplish cant be done with just C++ alone, you need to use the windows API to get keyboard key press input.