Jump to content

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

Binding Two Keys to One Key?



  • Please log in to reply
2 replies to this topic
liu777
  • Members
  • 5 posts
  • Last active: Jul 03 2014 06:39 PM
  • Joined: 30 Jun 2014

Hi, I'm trying to write a script for a game to bind two keys to one.

Specifically, I wish to bind the Q and E key to the space bar.

 

I've found this which works: 

 

space::q

 

this activates q whenever I press spacebar, but something like:

 

space::(q+e) autohotkey does not recognize.

 

the QE combo in the game preforms a sequence that I must be able to cancel by releasing both keys at any time. 

 

this program here:

 

space::

Send {q down}{e down}{q up}{e up} 

 

doesn't work for me because it only spams the beginning of the attack animation, resetting the attack very rapidly (and making my character look like he is spazing out.

 

So, to reiterate my question.

 

space::q works

 

is there a way to input space::(q+e) in autohotkey?

 

 



robert_ilbrink
  • Members
  • 561 posts
  • Last active: Nov 07 2019 05:14 PM
  • Joined: 05 May 2012

Not quite sure what your problem is. Could it be that the space bar repeats?

space::
    Send {q down}e{q up}
Return

This should do exactly what you want, sending the Q down, then the E, then the lift the Q. If repeat of the space bar is an issue then you would have to do more to test if Space has been lifted first or launch when the space bar has been lifted, which can be annoying due to the small delay.



Exaskryz
  • Members
  • 3249 posts
  • Last active: Nov 20 2015 05:30 AM
  • Joined: 23 Aug 2012
✓  Best Answer

Try this

 

space::
Send {q down}{e down}
KeyWait, space
Send {q up}{e up}
return

 

The KeyWait will wait for you to release the space bar before continuing.