AutoHotkey Community

It is currently May 27th, 2012, 12:38 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: September 14th, 2005, 2:45 pm 
Suppose I have three scripts:

One script holding the hotkeys for application start (as seen in my last post) called programs.ahk
Contains e.g.
F12 & d::Run, %ProgramFiles%\SmartFTP\SmartFTP.exe

One script containing the hotkey helper an the hotkeys I use for text editing called hotstrings.ahk. The hotkey helper is also bound to a combination with F12 & h:: ; Start the hotkey helper

Finally AutoHotkey.ini that contains among other definitions an inclusion of my programs.ahk at the beginning:
#Include *i programs.ahk
And also a hotkey to start the hotstings script:
Code:
^Tab::
{
  DetectHiddenWindows, On
  SetTitleMatchMode, 2
  IfWinExist, hotstrings.ahk - AutoHotkey
  {
    WinClose
  }
  else
  {
    Run, hotstrings.ahk
  }
  return
}

The start and termination of the hotstrings.ahk is working properly but if it is started the F12 & d:: and other F12 hotkeys in programs.ahk won't be aktivated any more. If I replase the hotkey for the hotstring helper with F11 & h, the F12 hotkeys from the other file will still do.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: September 14th, 2005, 4:15 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Since F12 is a prefix key (one that appears first in a combination such as F12 & d), the F12 keystroke is hidden from all other programs, including other scripts. This is by design because it allows scripts to override the hotkeys of other scripts and applications.

One way to work around this is to have all hotkeys that use the same prefix key (F12) in the same script.

Alternatively, you could add a tilde (~) in front of the F12 in the hotkeys of the overriding script. This will allow the F12 keystroke to pass through to the script underneath, which will then suppress the F12 keystroke because its F12 hotkeys do not have the tilde prefix. This approach relies on the fact that the non-tilde script is always running. If it isn't, the F12 keystroke from the tilde script will pass through to the active window and that window will act as though you had pressed F12.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 21st, 2005, 6:10 pm 
Thanks for the advice. This works great :-)


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

All times are UTC [ DST ]


Who is online

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