Hi can anyone teaching me about how write a C++ program to stop a timer to continue counting by just simply press ALT on keyboard to stop it
or just press s on keybord it will automatic start to counting without press s already then press enter the program just to start.
For other example if dont understand then i may give another example
when we enter a system ("pause"); it will come out with Press any key to continue. But at here I want just to press an ALT key to stop the timer continue to counting.
I am using DEV. Thx for the one who reply first.
You may e-mail to me juliustan88@hotmail.com
To check for input without waithing, you can use getch() from conio.h. You can use a typecast to integer, to make it easy to compare. Search in this forum if you need more information.
I am not hoping for code I want to get the ideal which field I should go in to fine.
the timer i know how to do.
but how to stop it by just press Alt 1 time in keybord without pressing enter.
And becasue in the ASCII there are no any code for ALF SHIFT CTRL ect
so how we can make it to get the signal when user press the keybord and it can react immediately.(press ALT then the timer will stop to count)
thx for the link it is very usefull
but at here i got another question to ask
if GetAsyncKeyState(VK_code) is to get any key you want into buffer
then got any ideal to clear/flush the buffer for that type of input???
else the keypress signal will always be there and i want the user to press that key again will fail casue it like keep on looping the same thing.