CUSTOMIZATION

HotKey is highly customizable:

  1. You can change the hotkeys bound to each function from the defaults (it is not necessary to use all the functions -- you can use only the ones you find helpful).
  2. You can specify webpages, programs, command prompt locations, files, and keystrokes (up to 30 of each) for the customizable functions (GetPage, RunProg, CommandAnywhere, OpenFile, and SendKeys).

Be sure to refer to the key specification page for complete information on specifying hotkeys.

horizontal rule

Setting Your Own Hotkeys

Each time HotKey starts (or the hotkeys are toggled off and then back on using ToggleOnOff), it reads a file in the installation directory callled keys.cfg. This is a simple text file that tells HotKey which key combinations to bind to which functions. Each key/function combination is specified on its own line in the file, and assignments are made using the following syntax:

<keys> ~~~ <FunctionName>

The "triple-tilde" (~~~) is used as an assignment operator to bind (assign) the keys to a function. All white space is ignored (you can include as much as you want, even on lines where key assignments are made). In addition, any line not containing the ~~~ operator is ignored -- you can use these lines for comments if you wish. If you would like to remove a key binding, but think you may want it back later, the easiest solution is to simply change the ~~~ on the corresponding line in keys.cfg to a ~~ ("double-tilde").

So, to customize HotKey, simply modify the keys.cfg file to fit your preferences, using the functions page as a guide. A complete list of key representations is given on the key specification page, which you are strongly encouraged to read so that you understand exactly how setting hotkeys works.

Below is a very simple example of an acceptable keys.cfg file:

!^{F4}    ~~~ CloseAll
^+b       ~~~ EmptyBin

Here are some comments -- they will be ignored
In the next valid config line, I have disabled
the KillHotKey binding I may want this later,
so I have not erased it. To enable it I just
need to add another ~

!^+x    ~~        KillHotKey

!+^ ~~~ Calculator

Note: Function names are case-insensitive: volup works just as well as VolUp when customizing hotkeys.

horizontal rule

Custom Webpages, Programs/Batch File Executables, Command Prompt Locations, Files, and Keystrokes

Some special functions allow you to open webpages, run programs and batch files, start command prompts in specific folders, open files (or folders; see below) with the associated default prorgams, and send user-defined keystrokes. Respectively, these functions are:

Like other HotKey functions, key bindings for these functions are specified in the keys.cfg file, but with an additional parameter supplied:

  <keys> ~~~ GetPage <URL or full\local\path\to\file>
  <keys> ~~~ RunProg <full\path\to\program [-optional command line parameters]>
  <keys> ~~~ CommandAnywhere <full\path\to\starting\location>
  <keys> ~~~ OpenFile <full\path\to\file>
  <keys> ~~~ SendKeys <keys>

Here are some examples:

Open Google.com with CTRL + SHIFT + G
^+g ~~~ GetPage http://www.google.com

Open a local HTML file with CTRL + SHIFT + H
^+h ~~~ GetPage C:\path\to\file.html

Open MS Word with CTRL + SHIFT + W
^+w ~~~ RunProg C:\Program Files\Office\Office10\WINWORD.EXE

Run a program with a command line parameter with CTRL + ALT + P
^!p ~~~ RunProg C:\Program Files\program.exe -foo

You do not need to specify the full path to Internet Explorer
^!i ~~~ Explorer

Open An MS Word file on the C drive in MS Word with CTRL + SHIFT + F
^+f ~~~ OpenFile C:\myfile.doc

Open a command prompt in D:\MyFolder with CTRL + ALT + F
^!f ~~~ CommandAnywhere D:\MyFolder

Have HotKey "type" your letter signoff with CTRL + ALT + S
^!s ~~~ SendKeys Sincerely,{ENTER}{ENTER}John Doe

You can set up to 30 pages for GetPage, up 30 executables (applications or batch files) RunProg, up to 30 locations for CommandAnywhere, up to 30 files for OpenFile, and up to 30 keystroke definitions for SendKeys. Any additional specifications beyond that will be ignored.

The MyBrowser Directive

HotKey automatically detects your default browser for the GetPage function. If for some reason you would rather that HotKey opens all your pages in another browser, you can use the MyBrowser: directive in your keys.cfg file. Just put the directive MyBrowser: followed by the path to your internet browser application on a line by itself. For example:

Set the browser HotKey uses to be different than your default
(in this case we'll set it as Firefox)
(the path to your browser may vary)
MyBrowser: C:\Program Files\Mozilla\firefox.exe

horizontal rule

Tips and Tricks with RunProg, OpenFile, and GetPage

1) You can open folders in several ways. The easiest is just to use OpenFile with the path to the folder you want to open, e.g.


Open the Program Files directory with CTRL + ALT + SHIFT + F
^!+f  ~~~ OpenFile C:\Program Files\

but you can also use RunProg like this:

Open the Program Files directory with CTRL + ALT + SHIFT + F
^!+p ~~~ RunProg Explorer C:\Program Files\

If your browser is set as Internet Explorer (either it is your default browser, or you have set it in your keys.cfg file using the MyBrowser: directive) GetPage can be used to open folders (since they are in fact opened in Explorer). Just supply a folder or file path instead of an URL:

Open the C: drive with CTRL + ALT + SHIFT + C
^!+c ~~~ GetPage C:\

This would open page.html located at C:\page.html
^!+c ~~~ GetPage C:\page.html

______________

2)Rememer that RunProg can be used to execute batch files. For example, suppose you want to open a few web pages at once. One option would be to bind each page to a hotkey using GetPage, and then just open each page individually. Another option is to make the following batch file (call it pages.bat), which you then call with RunProg:

Explorer http://www.firstpage.com
Explorer http://www.secondpage.com
Explorer http://www.thirdpage.com

or if your browser is Firefox, the batch file would be (the path to firefox.exe may vary on your system -- this should also work with other browsers, such as Opera):

"C:\Program Files\Mozilla\firefox.exe" http://www.firstpage.com
"C:\Program Files\Mozilla\firefox.exe" http://www.secondpage.com
"C:\Program Files\Mozilla\firefox.exe" http://www.thirdpage.com

This way, instead of opening each page sequentially with several different hotkeys, you open all of them together with one command. Obviously, that is a fairly trivial example -- you could make a much more powerful batch file, and then assign it to a hotkey, allowing you to execute that series of commands with just one key press whenever you need to.

______________

3) If you are running an external program that generates an output file or takes files as input using RunProg, be aware that the working directory is the one where HotKey is installed! (not the one where the external program is located). If you want to specify files outside of the HotKey folder, you therefore need to provide the full paths (or relative paths from the HotKey installation folder, but that is usually more trouble). So, instead of

^!g  ~~~ C:\myfolder\program.exe inputfile.txt outputfile.txt

where inputfile.txt and outputfile.txt are in the same folder as the program (C:\myfolder\), you would need to use

^!g  ~~~ C:\myfolder\program.exe C:\myfolder\inputfile.txt C:\myfolder\outputfile.txt

This approach may cause problems in some programs, especially if your paths contain spaces. In this case, the best thing to do is create a batch file and call that from HotKey. For example the batch file might be like this:

C:
cd "C:\path\to\my program folder\"
myprogram.exe inputfile outputfile

and you could run this via HotKey as

^!g  ~~~ C:\path\to\batchfile.bat

This approach may also be helpful if you are having trouble passing command line arguments to your program in the keys.cfg file.