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 

#Delay [ms]

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
jonny



Joined: 13 Nov 2004
Posts: 3004
Location: Minnesota

PostPosted: Wed Feb 02, 2005 4:05 am    Post subject: #Delay [ms] Reply with quote

It'd be nice to have an option, such as this, to delay the starting of a script. This is different from a Sleep at the top because it's a processing directive; that is, the idea is for the script to do nothing until the specified period has elapsed.

The reason I currently need this is that my mouse driver takes a while to start up at boot time, and my main script starts before (as I've placed it in the registry, which has higher precedence than the Startup folder), so the mouse hook interferes with it. The only work-around I've found using only AutoHotkey is making another script that sleeps, then runs the main one.
Back to top
View user's profile Send private message
BoBo
Guest





PostPosted: Wed Feb 02, 2005 9:14 am    Post subject: Reply with quote

Isn't the loading of that driver a separate "process" which can be triggered ? Please check the TaskManager.
What about the appearance of the mouse itself ?
What about to check/wait till its idle for x secs?
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Wed Feb 02, 2005 2:51 pm    Post subject: Reply with quote

Another thing you could do is enable all your mouse hotkeys via the hotkey command after a short delay. The mouse hook is not installed until then (unless your script contains #InstallMouseHook).

I think the Suspend command would also work: By suspending your hotkeys for a short time when the script first starts, the mouse hook should be removed, and then put back when suspend is turned off.

Has anyone else run into this issue?
Back to top
View user's profile Send private message Send e-mail
jonny



Joined: 13 Nov 2004
Posts: 3004
Location: Minnesota

PostPosted: Wed Feb 02, 2005 9:53 pm    Post subject: Reply with quote

Quote:
Another thing you could do is enable all your mouse hotkeys via the hotkey command after a short delay.


Is there a way to totally delay the enabling of a hotkey? "Hotkey,,Off" still leaves a short time before it runs to disable the hotkey. If there is a way, though, I could wait for the driver's hidden window to exist before it enables them.

@BoBo:

The mouse "exists" before the driver is activated, and it can be used too. Apparently it needs to be at least installed, though, and the XButtons can't be used without it running. (The XButtons are the hotkeys, so it'd be kind of pointless to disable the driver)
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Wed Feb 02, 2005 11:22 pm    Post subject: Reply with quote

jonny wrote:
Is there a way to totally delay the enabling of a hotkey?
The only way I can think of, other than the ones mentioned, is to create all mouse hotkeys with the Hotkey command. In other words, make it so that the mouse hotkeys do not even exist until after the delay.
Back to top
View user's profile Send private message Send e-mail
jonny



Joined: 13 Nov 2004
Posts: 3004
Location: Minnesota

PostPosted: Wed Feb 02, 2005 11:52 pm    Post subject: Reply with quote

Ok, thanks. I assume the below means that double-colon hotkeys are processed at startup, while Hotkey hotkeys aren't enabled until the function is encountered:

Quote:
Creating hotkeys via double-colon labels performs better than using this command because the hotkeys can all be enabled as a batch (rather than one by one) when the script starts.


And this couldn't be clearer:

Quote:
The keyboard and/or mouse hooks will be installed or removed if justified by the changes made by this command.


So, I can start a script without starting the mouse hook, too. A little WinWait here and Hotkey there, and the problem is solved! Cool
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List All times are GMT
Page 1 of 1

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


Powered by phpBB © 2001, 2005 phpBB Group