Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Need help with simple AHK queries.



  • Please log in to reply
4 replies to this topic
ThisFieldIsRequired
  • New members
  • 3 posts
  • Last active: Sep 17 2015 11:05 AM
  • Joined: 15 Sep 2015

Hi,

 

I need help with my AHK script.

 

How do I make a script where I hold down Left Ctrl button while continuously pressing "E" key simultaneously?

 

Also I would like the activation key to be "Z" key.

 

Thanks in advance.

 



Shadowpheonix
  • Members
  • 268 posts
  • Last active:
  • Joined: 10 Feb 2014

z::
Send {LCtrl Down}
While GetKeyState("z", "p")
{
Send e
Sleep 100
}
Send {LCtrl Up}
Return


ThisFieldIsRequired
  • New members
  • 3 posts
  • Last active: Sep 17 2015 11:05 AM
  • Joined: 15 Sep 2015
z::
Send {LCtrl Down}
While GetKeyState("z", "p")
{
Send e
Sleep 100
}
Send {LCtrl Up}
Return

Thank you so much for your help, work like a charm, except that rather I hold down Z, issit possible to make it so that I only need to press once to run the script then deactivate the script by pressing the same Z again?



Shadowpheonix
  • Members
  • 268 posts
  • Last active:
  • Joined: 10 Feb 2014
✓  Best Answer

Try this...

$z::
Toggle := !Toggle
If Toggle
{
    Send {LCtrl Down}
    While Toggle
    {
        Send e
        Sleep 100
    }
    Send {LCtrl Up}
}
Return
 
$^z::
If Toggle
    Toggle := !Toggle
Else
    Send ^z
Return


ThisFieldIsRequired
  • New members
  • 3 posts
  • Last active: Sep 17 2015 11:05 AM
  • Joined: 15 Sep 2015

 

Try this...

$z::
Toggle := !Toggle
If Toggle
{
    Send {LCtrl Down}
    While Toggle
    {
        Send e
        Sleep 100
    }
    Send {LCtrl Up}
}
Return
 
$^z::
If Toggle
    Toggle := !Toggle
Else
    Send ^z
Return

Thank you so much! Cheers!