mecro
mecro

Reputation: 11

AUTOHOTKEYS and how to press to buttons with one

i wanna use a script on ahk that when i press the key ''4'' it presses keys 4 + w (first 4 then W) how can i do this? is there a program for it except ahk that makes it easier?

Upvotes: 0

Views: 699

Answers (2)

0x464e
0x464e

Reputation: 6489

Use the built-in remapping syntax:
~4::w

~ makes it so the hotkeys isn't consumed when fired.
And if you wanted to add more keys, such as numpad4 like in the other answer, you'd do it nice and short like this:

~Numpad4::
~4::w

Upvotes: 0

akshif
akshif

Reputation: 191

This script will first send the key 4 followed by w. ~ before key keeps its default behavior.

~4::
    Send, w
return 

;~ digit 4 on numpad
~Numpad4::
    Send, w
return 

Upvotes: 2

Related Questions