AutoHotkey Community

It is currently May 27th, 2012, 9:13 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: November 23rd, 2011, 4:17 am 
Offline

Joined: November 8th, 2011, 5:33 am
Posts: 8
Location: Malaysia
my 1st code is

F1::
{
Sleep, 7
Send {1}
Sleep, 2
Send {2}
Click
}

and my 2nd one is

F3::
{
Sleep, 7
Send {1}
Sleep, 2
Send {2}
Click
}


how do i combine this 2 ahk to an ahk?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 23rd, 2011, 4:27 am 
Offline

Joined: June 28th, 2007, 1:08 am
Posts: 662
Simply follow your first hotkey with the Return statment. This halts the script flow at that point.

Also, please post in code tags in the future, it makes it much easier to read, like so:
Code:
F1::
   Sleep, 7
   Send {1}
   Sleep, 2
   Send {2}
   Click
   Return

F3::
   Sleep, 7
   Send {1}
   Sleep, 2
   Send {2}
   Click
   Return

_________________
RECOMMENDED: AutoHotkey_L
Some of the code I write will not work without it.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 23rd, 2011, 4:39 am 
Offline

Joined: February 17th, 2008, 8:52 pm
Posts: 314
You could also do this since both hotkeys are sending the same commands.

Code:
F1::
F3::
   Sleep, 7
   Send {1}
   Sleep, 2
   Send {2}
   Click
Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 23rd, 2011, 4:41 am 
Offline

Joined: June 28th, 2007, 1:08 am
Posts: 662
vahju wrote:
You could also do this since both hotkeys are sending the same commands.


True, though I was assuming that there was intent on having multiple, varied hotkeys in the future :wink:

_________________
RECOMMENDED: AutoHotkey_L
Some of the code I write will not work without it.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 23rd, 2011, 5:26 am 
Offline

Joined: November 8th, 2011, 5:33 am
Posts: 8
Location: Malaysia
Thanks ! You guys helped me alot. <3


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, Google Feedfetcher and 67 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group