Hi again. I have created a program and part of it is to see how many times the user presses a certain key to check keys I am using the following function.
My problem is simple I have locked my program down to 30 frames a second the trouble with this is, that the user holds the actual key down more than a 30th of a second so the counter counts that they have pressed the key more than once.Code:inline bool keyDown(int vkCode) { if (GetAsyncKeyState(vkCode) & 0x8000) return 1; else return 0; }
Now to stop this I tried slowing down the program but i had to slow it down to 5 frames per second before it stopped doing it. Now as you can imagine a program running at 5 frames per second is just far to slow. I was wondering if there was another way to tackle this problem.