2

I am trying to make a script that would fire a key if it comes from user, but not from script in AutoHotKey.

How can achieve this: if a is pressed - ab is typed. if b is pressed - c is fired.

2 Answers 2

2

You can use ~a::b as a sign of "send a through, then send b".

If you are to use that three line method - you would need to use $ to avoid infinite a:: firing:

 $a::   
 Send {a}{b}  
 Return  

This works as expected.

Sign up to request clarification or add additional context in comments.

Comments

2

Use this

~a::b
b::c

You can also do

$a::
Send {a}{b}
Return

Both work, but first is cleaner.

Fixed a bug.

1 Comment

Your second example would produce bbbbbbbbbbbbbb...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.