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 

v1.0.41 released: Context-sensitive hotkeys & hotstrings
Goto page 1, 2  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Announcements
View previous topic :: View next topic  
Author Message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10450

PostPosted: Thu Jan 19, 2006 11:41 pm    Post subject: v1.0.41 released: Context-sensitive hotkeys & hotstrings Reply with quote

Here are the changes for v1.0.41:

Fixed "Transform HTML", which was broken by v1.0.40.02. [thanks Rabiator]

Improved syntax to support One True Brace (OTB) style with IFs, ELSEs, functions, and normal loops.

Added built-in variable A_AhkPath, which contains the full path and name of AutoHotkey.exe (if available).

Added directives #IfWinActive/Exist to enable selected hotkeys and hotstrings for only the windows you specify.


Last edited by Chris on Mon Jan 23, 2006 2:15 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
toralf



Joined: 31 Jan 2005
Posts: 3842
Location: Bremen, Germany

PostPosted: Fri Jan 20, 2006 8:30 am    Post subject: Reply with quote

Thanks for the OTB, although it will require to change a lot in the Auto-Syntax-Tidy, I believe it is a good improvement.
_________________
Ciao
toralf
Back to top
View user's profile Send private message Send e-mail Visit poster's website
PhiLho



Joined: 27 Dec 2005
Posts: 6702
Location: France (near Paris)

PostPosted: Fri Jan 20, 2006 10:09 am    Post subject: Reply with quote

Yeah!
I don't care much for the OTB, as I don't use this style of coding, but it is nice for those which cannot live without it...

I eagerly awaited the context sensitive hotkeys.
Indeed, there was workarounds like:
Code:
$F9::
   appName = Create Folder
   WinGetClass winClass, A
   If winClass != ExploreWClass
   {
;      MsgBox 16, %appName%, Oops, wrong window...
      Send {F9}
      return
   }
but it wasn't very nice, adding a lot of code and not being very readable.
Your solution is nice, very well made (the idea of group of windows is excellent) and practical.

Congratulations, you are doing an excellent job on this software!
Back to top
View user's profile Send private message Visit poster's website
Titan



Joined: 11 Aug 2004
Posts: 5007
Location: imaginationland

PostPosted: Fri Jan 20, 2006 1:04 pm    Post subject: Reply with quote

The OTB feature adds greater flexibility to the way scripters can code which is terrific. The window-specific hotkeys are also a useful addon. Thanks Chris.
Back to top
View user's profile Send private message Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10450

PostPosted: Fri Jan 20, 2006 2:30 pm    Post subject: Reply with quote

Thanks. The #IfWin feature isn't as useful as I'd originally envisioned because I ran into some roadblocks when trying to implement it (such as thread-safety in the hook thread).

Hopefully the feature will get improved to support %Var% in parameters. Eventually, it may also allow duplicate hotkey labels as Evl suggested at http://www.autohotkey.com/forum/viewtopic.php?t=7485
Back to top
View user's profile Send private message Send e-mail
Demokos



Joined: 28 Dec 2005
Posts: 84

PostPosted: Fri Jan 20, 2006 6:40 pm    Post subject: Reply with quote

Chris wrote:
Hopefully the feature will get improved to support %Var% in parameters.
I would like to see that. Thanks for this very usefull release.
Back to top
View user's profile Send private message
BoBo
Guest





PostPosted: Sat Jan 21, 2006 4:16 pm    Post subject: Reply with quote

Quote:
Improved syntax to support One True Brace (OTB) style with IFs, ELSEs, functions, and normal loops.
Kinda coincidence Very Happy. I had a look at Perl two days ago. To get into the right mood for that, I've checked a script of one of my colleagues and have seen that style of coding for the first time (well, I'm not a programmer Rolling Eyes). Whopeee, that means that I can use the same technique with AHK & Perl.

Thx. Cool
Back to top
beardboy



Joined: 02 Mar 2004
Posts: 444
Location: SLC, Utah

PostPosted: Sat Jan 21, 2006 11:25 pm    Post subject: Reply with quote

With the #IfWin directives, can ahk_id be added as a WinTitle option? The use will be rare, so only if it doesn't add a lot of code size or time to add.

thanks,
beardboy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
evl



Joined: 24 Aug 2005
Posts: 1237

PostPosted: Sun Jan 22, 2006 12:34 am    Post subject: Reply with quote

As beardboy said, it would be handy - it would also be more consistent with other commands. To be useful though, it would need to be able to accept variables for the ID (as Chris already mentioned might be added).
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10450

PostPosted: Sun Jan 22, 2006 3:37 am    Post subject: Reply with quote

I believe ahk_id and ahk_pid are already supported. The only reason they're not mentioned is what Evl said: Without %Var% support, they would be useful only in unusual circumstances such as a script creating another script via FileAppend.

However, it might be of use that GroupAdd can add a series of ahk_id's or ahk_pid's to a group. You can then use that group with #IfWin. Also, you can keep adding more id's and pid's to such a group as long as you want -- and as long as the list doesn't get huge, performance shouldn't be affected much.
Back to top
View user's profile Send private message Send e-mail
beardboy



Joined: 02 Mar 2004
Posts: 444
Location: SLC, Utah

PostPosted: Sun Jan 22, 2006 4:05 am    Post subject: Reply with quote

Chris, thanks for the work around solution.

thanks,
beardboy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10450

PostPosted: Tue Jan 31, 2006 11:17 pm    Post subject: Reply with quote

Here are the changes for v1.0.41.01:

Fixed AltGr hotkeys that send AltGr characters such as "<^>!a::Send \" in German. [thanks AGU]
Fixed Gui +Disable/AlwaysOnTop to work even if other options are present on the same line. [thanks evl]
Improved syntax to support having a command on the same line as an open-brace. [thanks segfault]

The tentative plan for the next major release is to support duplicate hotkeys and hotstrings for easier context sensitivity with the #IfWin directives.
Back to top
View user's profile Send private message Send e-mail
Titan



Joined: 11 Aug 2004
Posts: 5007
Location: imaginationland

PostPosted: Tue Jan 31, 2006 11:27 pm    Post subject: Reply with quote

Chris wrote:
Improved syntax to support having a command on the same line as an open-brace. [thanks segfault]

Nice one however this does not apply to OTB. Is this intentional?

For example this works:
Code:
Loop, 3
{ MsgBox, %n%
   n += 10
}
But not this (OTB):
Code:
Loop, 3 { MsgBox, %n%
   n += 10
}

_________________

RegExReplace("irc.freenode.net/autohotkey", "^(?=(.(?=[\0-r\[]*((?<=\.).))))(?:[c-\x73]{2,8}(\S))+((2)|\b[^\2-]){2}\D++$", "$u3$1$3$4$2")
Back to top
View user's profile Send private message Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10450

PostPosted: Wed Feb 01, 2006 12:32 am    Post subject: Reply with quote

Yes, it's intentional because the extra code size didn't seem justified given how rarely anyone would want to use such an ugly style Smile

It is also documented on the Block page under the OTB section: "However, open-braces of the One True Brace style do not support commands to their right."
Back to top
View user's profile Send private message Send e-mail
PhiLho



Joined: 27 Dec 2005
Posts: 6702
Location: France (near Paris)

PostPosted: Wed Feb 01, 2006 9:28 am    Post subject: Reply with quote

Well, I do find the first style (the one you just allowed) ugly too, perhaps that's why it is rarely used.
Ugly and impratical if you have to add a new command just before the first line of the block.
And with no clear advantage over the OTB style, ie. no gain of line. Well, at least, braces are aligned, I find this more readable than OTB.

But well, it is good to have flexibility and to please as much people as possible, as long this doesn't bloat the code. Which seems to be a true concern for Chris Smile I like that.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Announcements All times are GMT
Goto page 1, 2  Next
Page 1 of 2

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


Powered by phpBB © 2001, 2005 phpBB Group