Jump to content

Registering Keyboard Shortcut/Hotkeys


Recommended Posts

I'm looking for a way to define a library of automated tasks that will each have their own hotkey.  I will want this "library" loaded and ready to go without me having to do anything but press the hotkey (no manual running a script file).  Is there a way to define a script file that loads every time Windows boots and is cached and ready to use?

Link to comment
Share on other sites

you could make 1 script and define hotkeys in that script... each hotkey will start your specified script.. compile them to exe to make it easier. then just put your main script(exe) in your startup folder at C:\Users\xxx\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

 

or just combine all scripts into 1.... that would be even better.

 

to leave the script running in the background you can use something like this:

While 1
    Sleep(1000)
WEnd

 

Link to comment
Share on other sites

I have this in my hotkey script to hide its appearance and you also need a hotkey to terminate the script.

 

If @Compiled = 0 Then AutoItSetOption("TrayIconHide", 0)
_Singleton("some randomsequence") ; prevent multiple copies  http://en.wikipedia.org/wiki/Singleton_pattern
HotKeySet("^!{F5}", "TerminateHotkeys") ; This one of the few CTRL-ALT F key that works under Windows 7

 

Edited by pseakins
typo, added singleton

Phil Seakins

Link to comment
Share on other sites

  • 2 weeks later...

@webmonkdev  If you wish to try this UDF.  It can simplify the management of multiple HotKeys while allowing you to have long lasting functions that will not interfere between each other :

 

Of course it is working with only one keyboard...

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...