Results 1 to 5 of 5
  1. #1
    gogogokitty's Avatar
    Join Date
    Feb 2013
    Gender
    male
    Posts
    1,090
    Reputation
    113
    Thanks
    3,503

    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
    LEEEEEEROY JEEEEENKINS

  2. #2
    Biesi's Avatar
    Join Date
    Dec 2011
    Gender
    male
    Posts
    4,993
    Reputation
    374
    Thanks
    8,808
    My Mood
    Twisted
    Code:
    bool pause = false;
    while(true)
    {
      if(!pause)
        //TODO?
    
      if(GetAsyncKeyState(HOTKEY) & 0x0001)
        pause = !pause;
    
      Sleep(25);
    }

  3. #3
    gogogokitty's Avatar
    Join Date
    Feb 2013
    Gender
    male
    Posts
    1,090
    Reputation
    113
    Thanks
    3,503
    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);
    }
    }
    	}
    Last edited by gogogokitty; 04-30-2014 at 09:01 PM.
    LEEEEEEROY JEEEEENKINS

  4. #4
    Biesi's Avatar
    Join Date
    Dec 2011
    Gender
    male
    Posts
    4,993
    Reputation
    374
    Thanks
    8,808
    My Mood
    Twisted
    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..

  5. #5
    gogogokitty's Avatar
    Join Date
    Feb 2013
    Gender
    male
    Posts
    1,090
    Reputation
    113
    Thanks
    3,503
    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
    LEEEEEEROY JEEEEENKINS

Similar Threads

  1. [Tutorial] How to use the infiSTAR menu (and possibly other menus) with #YoloHack
    By Xrider590 in forum DayZ Mod & Standalone Hacks & Cheats
    Replies: 11
    Last Post: 03-01-2013, 04:54 PM
  2. How do I install ARMA 2 OA with a key I bought for $3 from the forums?
    By wtan903 in forum DayZ Mod & Standalone Hacks & Cheats
    Replies: 4
    Last Post: 01-19-2013, 03:33 PM
  3. How to eneable dedicated server browser and Create a Class with all weapons
    By L in forum Call of Duty Modern Warfare 3 Tutorials
    Replies: 1
    Last Post: 04-13-2012, 01:58 AM
  4. How to make a simple Program With Notepad
    By NuB_GhOsT in forum Programming Tutorials
    Replies: 9
    Last Post: 01-15-2010, 08:16 PM
  5. [Help] How to close a program with a hotkey (VB6).
    By wr194t in forum Visual Basic Programming
    Replies: 7
    Last Post: 11-22-2007, 06:07 AM