AutoHotkey Community

It is currently May 27th, 2012, 6:59 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 

Did you correctly predict outcome of typing q & z ?
Yes
No
Yes (but I'm lying)
You may select 1 option

View results
Author Message
PostPosted: February 12th, 2012, 12:48 am 
Offline

Joined: January 22nd, 2012, 1:11 pm
Posts: 8
Location: Vancouver
Here's a little challenge: predict what will happen if you save this script under the name weirdflow, run it, and with its own window active (which is just a way of establishing a true #If condition), type q and then z.

Code:
#NoEnv
SendMode Input

#ifwinactive weirdflow
j::send pigs
w::send j
q::send w

#if
y::send cows
x::send y
z::send x


The answers are given in white, below, as a way of avoiding spoilers. Select the block to see (it stands out against the highlighting).

For reasons I have been unable to imagine, in the case without any context condition, the script's output is dumped back into the script, and can trigger more hotkeys in a daisy chain which can be extended indefinitely. In the example, typed z generates "cows."

Also weird is the effect of specifying a context condition which was always fulfilled. You would think that does nothing; but in fact it shuts down the flow, and sends initial script output to the client: typed q generates q.


If there's a rationale for this, I'd be very interested to hear it.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 12th, 2012, 5:52 am 
Offline

Joined: April 8th, 2009, 7:49 pm
Posts: 6073
Location: San Diego, California
You have failed to read part of the documentation or perhaps didn't understand.
There are 12 hotkey modifiers including "$".
Please read about it and the other 11, it is time will spent. :wink:

http://www.autohotkey.com/docs/Hotkeys.htm#Symbols

http://l.autohotkey.net/docs/Hotkeys.htm#Symbols


For your edification, information and amusement -- may I suggest working through the tutorials ?
http://www.autohotkey.com/docs/Tutorial.htm
http://www.autohotkey.com/forum/viewtopic.php?t=47791


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], migz99, sjc1000 and 73 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