AutoHotkey Community

It is currently May 26th, 2012, 10:46 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: September 17th, 2009, 4:12 pm 
Offline

Joined: February 5th, 2007, 3:37 pm
Posts: 31
Below example works as standalone, but on top of my 1500 lines of code it doesnt. Anyone have experience what I should look for ? What can be blocking the Hotkey command ?
I dont' have "test" or F1 in my script.
Thanks in advance for any help :)

Code:
test=F1
HotKey, %test%, test
return

test:
msgbox, you pushed %test%
return


Last edited by AnAHKUser on September 19th, 2009, 6:09 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 17th, 2009, 4:23 pm 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
http://www.autohotkey.com/docs/Scripts.htm#auto

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 17th, 2009, 7:02 pm 
Offline

Joined: February 5th, 2007, 3:37 pm
Posts: 31
Thanks, but my problem is not to get my script running, but to get the hotkey working. I put example on top just for troubleshooting. Still something in my code seem to block the hotkey....


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 17th, 2009, 8:15 pm 
Offline

Joined: May 27th, 2007, 9:41 am
Posts: 4999
We can't tell without seeing the rest of the code, my initial idea was that you have placed the hotkey command below something else (e.g. below the auto execute part of your lengthy script) so the script doesn't see it and therefore might not work. Did you really put it at the very very top (e.g. the first line)? Is there another place in the script where you define a test variable which isn't a hotkey or another hotkey?

_________________
AHK FAQ
TF : Text files & strings lib, TF Forum


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 17th, 2009, 9:58 pm 
Offline

Joined: February 5th, 2007, 3:37 pm
Posts: 31
Thanks for your effort HugoV.
I understand it not easy to answer it by only my description.

The example file was put on the very first line and I triple checked that there wasn't a variable or label crash.
The script runs without any error, but nothing happens on key pressed. I have tried several keys, variables and label names.

On new .ahk document it works without any problem, but not in my code.

I'm running XP 32bit, so no UAC Vista issues etc.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 19th, 2009, 6:09 pm 
Offline

Joined: February 5th, 2007, 3:37 pm
Posts: 31
I finally found the bug by disabeling portions after portions of my code.
I have used context-sensitive hotkeys in my script with #IfWinActive. It basically blocks the 'hotkey command' if #IfWinActive is not turned off after use.

Here's an example on how to turn off context sensitivity specified in #IfWin directive (from help file):
Code:
#IfWinActive Reminders ahk_class #32770  ; The "reminders" window in Outlook.
Enter::Send !o  ; Have an "Enter" keystroke open the selected reminder rather than snoozing it.
#IfWinActive


Case closed, I'm happy :D


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], JSLover, Maestr0, Miguel, rbrtryn and 56 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