how to pause and continue a program with hot keys

Posts 1–5 of 5 · Page 1 of 1
how to pause and continue a program with hot keys
as the title says, ive googled this and found nothing. what should i do to try to pause the loop when the user presses a hotkey and then continue inside the loop when they press the same or another hotkey such as f11
Code:
bool pause = false;
while(true)
{
  if(!pause)
    //TODO?

  if(GetAsyncKeyState(HOTKEY) & 0x0001)
    pause = !pause;

  Sleep(25);
}
Quote Originally Posted by Biesi View Post
Code:
bool pause = false;
while(true)
{
  if(!pause)
    //TODO?

  if(GetAsyncKeyState(HOTKEY) & 0x0001)
    pause = !pause;

  Sleep(25);
}
when i put that in it made it it not do anything when i press my left mouse button
Code:
	if (userkey == "start"){
	while(true){

if (GetAsyncKeyState(VK_LBUTTON) & 0x0001)
	{
		keybd_event( VK_CONTROL,0x11,KEYEVENTF_EXTENDEDKEY | 0,0 );
        keybd_event( VK_CONTROL,0x11,KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP,0);
		cout << "Going prone ";
	}
{
	bool pause = false;
while(true)
{
  if(!pause)
    //TODO?

  if(GetAsyncKeyState(VK_F11) & 0x0001)
    pause = !pause;

  Sleep(25);
}
}
	}
Quote Originally Posted by gogogokitty View Post
when i put that in it made it it not do anything when i press my left mouse button
You should at least learn the basics of programming/c++ if you can't assemble codes..
Quote Originally Posted by Biesi View Post


You should at least learn the basics of programming/c++ if you can't assemble codes..
yea im still learning
Posts 1–5 of 5 · Page 1 of 1

Post a Reply

Similar Threads

Talk with us