AutoHotkey Community

It is currently May 27th, 2012, 10:17 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: June 9th, 2007, 6:48 pm 
if I try the following:

Code:
$F1::
loop{
F1::                           <<<ERROR ON THIS LINE
break

send ^v
send {enter}
}


I get the error "duplicate hotkey not allowed" or something similar. I can sorta understand why I get this error, but I cant get around it. All I would like to achieve is to switch a loop on/off by tapping F1. I'm stumped.

If anyone has any ideas please help me out here, thanks


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: June 9th, 2007, 7:40 pm 
Offline

Joined: December 1st, 2006, 9:27 am
Posts: 460
Try this:
Code:
SetTimer,looper,500   ;whatever rate you want
Return

looper:
   If(fOne)
   {   send ^v
      send {enter}
   }
Return

$F1::
   fOne := !fOne
Return

You are getting multiple hotkey errors because you are creating multiple references to F1::

_________________
Image


Last edited by Micahs on June 9th, 2007, 7:41 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 9th, 2007, 7:41 pm 
Offline

Joined: September 2nd, 2006, 6:39 am
Posts: 279
Location: Scotland
GetKeyState


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 9th, 2007, 10:17 pm 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8667
Location: Salem, MA
Help with simple code: loop stop when key pressed.
Breaking an infinite loop with keypress
a bit of help pls
Disconinuing a loop and then again continue
a hotkey to stop current hotkey
Start and Stop

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 11th, 2007, 2:14 pm 
thanx 4 all the help guys

Il try out all the suggestions and see what works


Report this post
Top
  
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: Bing [Bot], BrandonHotkey, Maestr0 and 62 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