AutoHotkey Community

It is currently May 26th, 2012, 9:23 am

All times are UTC [ DST ]




Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 1036 posts ]  Go to page 1, 2, 3, 4, 5 ... 70  Next
Author Message
PostPosted: July 26th, 2008, 8:15 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
AutoHotkey_L

AutoHotkey_L is my custom build of AutoHotkey. Primary features include:
Downloads

Source Code
Version History


Recent revisions do not support __expr or SimpleExpr.
If you must use these scripts, get Revision 13.
Otherwise, get the latest revision above.
Source code and binaries are available for L13.


Last edited by Lexikos on August 9th, 2011, 1:48 pm, edited 26 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 26th, 2008, 11:12 am 
Offline

Joined: November 2nd, 2004, 2:43 pm
Posts: 1019
Location: London, UK
First of all, WOW, some excellent additions there. Most useful for me will be the #If directive, assuming its what I think it is it will remove the need for me to keep activating and deactivating 30 odd hotkeys according to what I'm using my computer for.


Also just out of interest, have you discussed with Chris regarding merging some of these into the original, or do you intend to keep yours seperate??

_________________
Steve F AKA Superfraggle

http://r.yuwie.com/superfraggle


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 26th, 2008, 11:40 am 
Offline

Joined: March 11th, 2008, 11:36 pm
Posts: 291
#if (expression) sounds very useful eg) #if WinActive(win1) || WinActive(win2).
also it's good to have While loop though it seems a bit slow compared to Loop.
i had bunch of suggestions for future ahk (any build here)
but i would not make suggestion here which might cause pressure on you. i'll just cheer it up :)
Thanks for your contribution to community as always.
keep up your good work!

_________________
Easy WinAPI - Dive into Windows API World
Benchmark your AutoHotkey skills at PlayAHK.com


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 26th, 2008, 12:37 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
Quote:
Revision 7 - July 26, 2008
  • Added: IsFunc(FuncName) - Returns a non-zero number if FuncName exists in the script or as a built-in function.
Superfraggle wrote:
Also just out of interest, have you discussed with Chris regarding merging some of these into the original, or do you intend to keep yours seperate??
I'll get back to you on that...
heresy wrote:
also it's good to have While loop though it seems a bit slow compared to Loop.
In my brief tests, While (expression) performed marginally faster than Loop .. if (expression) .. else break. Were you comparing While expression to Loop count? Apples and oranges...

Btw, I use #if for hotkeys sensitive to:
  • the active control - to "fix" certain behaviours of Edit controls, and for a "toggle word-wrap" hotkey specific to Scintilla controls.
  • the window under the cursor - to exclude remote desktop and VMware from mouse hotkeys/gestures.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 26th, 2008, 12:46 pm 
Offline

Joined: March 19th, 2006, 5:52 am
Posts: 419
Don't have time to check it out right now, but any day where modifications and improvements are made to AutoHotkey is a good day.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 26th, 2008, 2:13 pm 
Offline

Joined: March 11th, 2008, 11:36 pm
Posts: 291
Lexikos wrote:
While (expression) performed marginally faster than Loop .. if (expression) .. else break.
You're right, there was a big mistake in my test. i could see that While (expression) is pretty optimized. Sorry

_________________
Easy WinAPI - Dive into Windows API World
Benchmark your AutoHotkey skills at PlayAHK.com


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 26th, 2008, 4:18 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
I found While is very handy. Thanks.
BTW, I'd like to make sure one thing: entering (or exiting?) While, is A_Index initialized/refreshed to zero? It seemed so in my test:
Code:
While   A_Index=0
   MsgBox % "Loop1: " . A_Index
While   A_Index=0
   MsgBox % "Loop2: " . A_Index

However, the result was different in the nested While:
Code:
While   A_Index=0
{
   MsgBox % "Loop1: " . A_Index
   While   A_Index=0
      MsgBox % "Loop2: " . A_Index
}

Looks like when entering the second While, A_Index is not refreshed to zero.
Code:
While   A_Index=0
{
   MsgBox % "Loop1: " . A_Index
   While   A_Index=1
      MsgBox % "Loop2: " . A_Index
   MsgBox % "Loop1: " . A_Index
}


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 26th, 2008, 6:08 pm 
Offline

Joined: June 26th, 2006, 6:14 pm
Posts: 1379
Location: USA
hey thanks for this.

_________________
Image
ʞɔпɟ əɥʇ ʇɐɥʍ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 27th, 2008, 1:14 am 
Offline

Joined: November 2nd, 2004, 2:43 pm
Posts: 1019
Location: London, UK
Lexicos, I have been trying a few things out with the #IF directive, and I noticed it has a timeout where it will fail if the expression takes too long.

Is there a way to increase/decrease/remove this timeout. I am aware that removing the timeout and then calling an infinate loop could disable keyboard input.

The reason I asked was I was running some tests using imagesearch basically creating some image sensitive hotkeys, and the imagesearchs tend to take a bit too long.

_________________
Steve F AKA Superfraggle

http://r.yuwie.com/superfraggle


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 27th, 2008, 1:31 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
Sean wrote:
I'd like to make sure one thing: entering (or exiting?) While, is A_Index initialized/refreshed to zero?
No, the expression is evaluated before the next iteration begins. In the case of the first iteration, it is evaluated before A_Index is given any value. Do you think A_Index should reflect which iteration is about to begin?

Btw, A_Index is normally 0 outside of any loops.
Superfraggle wrote:
Is there a way to increase/decrease/remove this timeout.
Not at the moment. Do you really want hotkeys that tie up the keyboard for longer than a second?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 27th, 2008, 1:53 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
Lexikos wrote:
Do you think A_Index should reflect which iteration is about to begin?
That could be quite useful, IMO, as While can be also used as a simplified For then. In that case, A_Index may better be initialized to 1 than 0 inside AHK's current scheme, though.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 27th, 2008, 9:07 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
Quote:
Revision 8 - July 27, 2008
  • Added: #IfTimeout directive to set the timeout for evaluation of #If expressions, in milliseconds. Default is 1000.
  • Added: Assume-static mode for functions. "Static" must precede any local/global variable declarations.
  • Added: One-true-brace support for While.
  • Changed: While now sets A_Index to the iteration about to begin.

Superfraggle, note also that Windows implements its own time-out for low-level hooks. The default appears to be 5000ms.
MSDN wrote:
The hook procedure should process a message in less time than the data entry specified in the LowLevelHooksTimeout value in the following registry key:

HKEY_CURRENT_USER\Control Panel\Desktop

The value is in milliseconds. If the hook procedure does not return during this interval, the system will pass the message to the next hook.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 27th, 2008, 2:32 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
Lexikos wrote:
Revision 8 - July 27, 2008
  • Added: #IfTimeout directive to set the timeout for evaluation of #If expressions, in milliseconds. Default is 1000.
  • Added: Assume-static mode for functions. "Static" must precede any local/global variable declarations.
  • Added: One-true-brace support for While.
  • Changed: While now sets A_Index to the iteration about to begin.

Assume-static and While with A_Index initialization work great. Thanks.
I realized I forgot to ask about this: Is there a particular reason that Break/Continue are forbidden inside While, or is it just an accidental omission?


Last edited by Sean on July 27th, 2008, 2:38 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 27th, 2008, 6:17 pm 
Congratz on first version of your code branch.
To do list is really awesome.

Cheers and good luck with this.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: July 27th, 2008, 9:14 pm 
Offline

Joined: November 2nd, 2004, 2:43 pm
Posts: 1019
Location: London, UK
Lexikos wrote:
Superfraggle, note also that Windows implements its own time-out for low-level hooks. The default appears to be 5000ms.
MSDN wrote:
The hook procedure should process a message in less time than the data entry specified in the LowLevelHooksTimeout value in the following registry key:

HKEY_CURRENT_USER\Control Panel\Desktop

The value is in milliseconds. If the hook procedure does not return during this interval, the system will pass the message to the next hook.


Excellent that works perfect, took me a while to get it working as desired, it appears at least on my XP system the default was 1000ms, the key didn't exist so I was unable to confirm that, but my tests seemed to confirm that. After creating the key, and setting it higher it worked with longer settings.

A point to any other users that may use this, If the IFtimeout is set higher than the windows default, this can resault in both the keys native function and your requested function being launched. Also if anyone does make changes to the key then you need to restart the computer for the changes to be picked up. (broadcasting a system setting change may help, but didnt have time to test.)

_________________
Steve F AKA Superfraggle

http://r.yuwie.com/superfraggle


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic This topic is locked, you cannot edit posts or make further replies.  [ 1036 posts ]  Go to page 1, 2, 3, 4, 5 ... 70  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 8 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