AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Two hotkeys, same effect

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
kidmar



Joined: 04 Oct 2007
Posts: 30

PostPosted: Thu Apr 03, 2008 8:19 am    Post subject: Two hotkeys, same effect Reply with quote

I would like to have two (or more) hotkeys do the same job.
It would be nice if i could write the code (or the call to a function) only once and not one time for each hotkey.

For example I need that when the user presses keys F10 OR F11 the function fun1() is called.
something like:

F10 (OR) F11::
fun1()
return

is it possible?
is it possible to know whitch hotkey triggered fun1()?
thank you
Back to top
View user's profile Send private message
tonne



Joined: 06 Jun 2006
Posts: 1259
Location: Denmark

PostPosted: Thu Apr 03, 2008 8:43 am    Post subject: Reply with quote

From the help file:
Quote:
Multiple hotkeys can be stacked vertically to have them perform the same action. For example:
Code:
^Numpad0::
^Numpad1::
MsgBox Pressing either Control+Numpad0 or Control+Numpad1 will display this message.
return

_________________
there's a dog barking close within the range of my ear
sounds like he wants to escape the chain
he would probably bite me to death if he could
but the chain lets me spit in his face

- Kashmir
Back to top
View user's profile Send private message
kidmar



Joined: 04 Oct 2007
Posts: 30

PostPosted: Thu Apr 03, 2008 9:00 am    Post subject: Reply with quote

I was looking for it in the help couse i knew it was there but I couldn't find it.
Thank you!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group