Thursday. 6.3.04 9:32 am
Ok, I tried this modification to stop the program from repeating the cout, but it only works once... here;s the orignal bit..
if(GetAsyncKeyState(VK_UP) != 0)
{
cout << "Oh yeah!" << endl;
while ( ++i < 100)
{;}
cout << "Boo!" << endl;
}
So it will show Oh yeah! stop.. then display Boo! on the first keystroke, but then go back to the massive repeating. Then I realized that i was never reset, so the cycle never restarted. So I tired the following.
if(GetAsyncKeyState(VK_UP) != 0)
{
i = 0;
cout << "Oh yeah!" << endl;
while ( ++i < 100)
{;}
cout << "Boo!" << endl;
i = 0;
}
This time it didn't even pause... Help?
possible solution
I haven't gotten a chance to actually try this out, but I'm pretty sure it will work.
if (GetAsyncKeyState(VK_UP) != 0)
{
cout << "Oh yeah!" << endl;
cout << "Boo!" << endl;
while (GetAsyncKeyState(VK_UP) != 0);
}
See how that works. It should only display the text once each time the key is pressed.
» thecav on 2004-06-03 07:03:17
wtf?
what are trying to do ? and with what program? i come home monday, for a couple of days, probably leaving again on thursday. i'll have to spend one evening with twy and all you guys.....
» lostsoul on 2004-06-03 09:45:16
I'm just playing woth code. And that sunds like fun, I'll just need to know what day so i can get permisson ot hang out.
» Bremma on 2004-06-04 10:03:25
Sorry, you do not have permission to comment.
If you are a member, try logging in again or accessing this page here.