Sign in to follow this  
Followers 0
kingsped

HotKeySet override existing "system" setting

5 posts in this topic

Got a new HP WIN7 box so tried a new script language (AutoHotKey). Played with it for a few days and wrote a startup script to assign some hotkeys. But tired of the syntax and then found AutoIT. Rewrote the startup script for AutoIT and it worked, mostly. One hotkey (Ctrl-Alt-s) was already assigned to an HP msgbox displaying system info. AutoHotKey replaced that assignment with mine but AutoIT doesn't seem to be able to unless I'm missing something.

Any help greatly appreciated if it can be done in AutoIT.

Sample of both scripts:

;
;   AutoIT sample
;
#NoTrayIcon
HotkeySet("^!s", "Scout")   ;# Scout            Ctrl-Alt-s
.
.
.
While 1
    Sleep(10000)
WEnd
.
.
.
Func  Scout()
    Send ("Hello World")
EndFunc

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

AutoHotKey Sample

#persistent
#notrayicon
#SingleInstance ignore
.
.

^!s::
Send Hello World
Return
.
.

Share this post


Link to post
Share on other sites



Lessen the Sleep value, make it 100, or even 10. IDK if that'll do it, but 10000 is more than is necessary anyway.


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

Bruce,

Thanks for the quick reply but the While loop delay is not the answer. The loop serves as the script's "heartbeat" to keep it alive and thereby keep the Hotkey assignments in effect. Once they have been established, the system reacts effectively immediately to their being pressed.

And I saw no reason to waste CPU cycles needlessly. You can set it to 7200 but you won't have to wait 2 hrs to get a hotkey response. Try it.

Share this post


Link to post
Share on other sites

I'm aware what the While loop delay is for, and what it does. I was just thinking that maybe 10 seconds was too long of a Sleep delay. How do you get two hours out of 7200 ms? That's less than 7 1/2 seconds.


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites

You can't take over hot keys without screwing something up.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0