I want to bind 2 keys, for example I and O to an action.
This is so I dont need to work as much for a specific game that I'm playing.
I::
sleep 10
send {LButton}
sleep 10
send {1}
However, I want to have O do the same thing, and preferably in an elegant way. I don't know how to do this, thanks!
Binding 2 keys to one action.
-
- Posts: 3
- Joined: 31 Jul 2022, 02:21
Re: Binding 2 keys to one action.
I just realized this is in Gaming instead of AutoHotkey help. My bad.
Re: Binding 2 keys to one action.
But this is for a game you were saying...?!
'Gaming' is just a subforum of 'Ask For Help', so that shouldn't be a problem. People will also help with topics posted here.
But games often have different requirements (eg Send options) than normal apps. So I guess this could be the right place.
(Although you could argue that this question has a general scope, if I understand it correctly. Let's see how it develops - we can still move it.)
'Gaming' is just a subforum of 'Ask For Help', so that shouldn't be a problem. People will also help with topics posted here.
But games often have different requirements (eg Send options) than normal apps. So I guess this could be the right place.
(Although you could argue that this question has a general scope, if I understand it correctly. Let's see how it develops - we can still move it.)
Re: Binding 2 keys to one action.
You can simply "stack" multiple hotkey labels that should run the same subroutine.
Is that what you are asking?
Is that what you are asking?
Code: Select all
i:: ; press i
o:: ; press o
sleep 10
send {LButton}
sleep 10
send {1}
return ; don't forget a return at the end of the subroutine
-
- Posts: 3
- Joined: 31 Jul 2022, 02:21
Re: Binding 2 keys to one action.
This seems to be good, thank you!
I didn't know you can stack keys like that, thanks for the information! You guys are pretty helpful.
I didn't know you can stack keys like that, thanks for the information! You guys are pretty helpful.