HotkeyP help

 The button "Add" creates a new hotkey at the end of list. The button "Insert" creates a new hotkey before the current item. Hotkeys can be also created by dragging & dropping icons from the desktop, or files from the explorer. Existing hotkey can be edited by double clicking on the item in the listbox. You can sort the list by clicking on the column header. If you sort it by the first column, then you can use a mouse to change order of items.

When you run HotkeyP for the first time, you must save your hotkeys to the file. Next time all changes will be saved automatically at the moment when you close the hotkeys window. Every user who logs in the Windows can create his own HTK file.

Hotkey can be any key combined with Ctrl, Shift, Alt, Win. Most keyboards have Win key placed between Ctrl and Alt. It is possible, but not recommended to define hotkeys like CapsLock, F1, Shift+A, Ctrl+C, Alt+F4. All multimedia keys can be used, but some other programs can block them and those programs must be closed or uninstalled. Some unknown keys are displayed as a number in parenthesis, but you can rename them in the options.

Each hotkey can be assigned to an executable file, document, www page or to some internal command. You can write file name directly into the "Command:" edit box or you can use "..." button to open the file dialog or you can drag and drop files from Explorer. You can use environment variables in the file path, for example %SystemRoot%. Variable %HotkeyP% is replaced by the installation folder where is HotkeyP.exe. If you don't specify path before the file name then directories from system variable PATH are searched.

You can also write a web page or email address directly to the command edit box. It must begin with www. or http:// or https:// or mailto:.

Internal command can be easily chosen from popup menu after mouse click on "<" button.

If you want to hear sound whenever you press a hotkey, you can enter WAV file to the "Sound:" field.

If you check "Enable multiple instances", each hotkey starts a new application. If you don't check this option and the application is already running, then the application is activated. If it is already active, then it is minimized. Option "Enable multiple instances" works only for executable files. If you open a document, it depends on the application whether it opens the document in a new window or in an already existing window.

If you check the "Add to the notification icon menu", this hotkey will be added the popup menu which is shown when you right-click the system tray icon. Write menu item string to the description field. If the description contains two characters ->, a submenu will be created. Submenus can be nested (for example submenu1->submenu2->item).

The checkbox "Run automatically after Windows starts" (in the Hot Key dialog box) works only if the HotkeyP is run automatically after the Windows starts, or if you start the HotkeyP manually with parameter 0.

You should check "Run as administrator" only if the application needs admin privileges. This option is useful if the User account control (UAC) is enabled in the Windows control panel (it is enabled by default). If the HotkeyP is not running as admin, annoying "User Account Control" dialog will be shown when the hotkey is pressed. If the HotkeyP is running as admin, it will be able to launch applications as administrator directly without consent.

Write description of the command to the "Description:" field. If you leave this note empty, the filename without path is used. The description is visible in the listbox in the main window.

Opacity is an integer from 0 to 255 which means from transparent to opaque. If the value is zero, the opacity will not be set and a program will start faster.

Mouse shortcuts

Mouse shortcuts are created similarly to keyboard shortcuts. Move mouse cursor on the white edit box that is at the top of the "Hot Key" window. Then press one or more mouse buttons or rotate the mouse wheel. The word Mouse will appear in the edit box and the sum of L, R, M, 4, 5, Up, Down, Left, Right. That means left button, right button, middle button, X1 button, X2 button, wheel up, wheel down, wheel left, wheel right. Mouse buttons can be combined with keys Ctrl, Shift, Alt, Win.

If your mouse has 5 buttons, but you cannot use the fourth and fifth buttons in HotkeyP, you may have installed a wrong driver or there is some application which blocks these buttons (e.g. Genius Netscroll+ Optical Mouse). You will have to close that application and remove it from the startup group. You must not uninstall Genius software because it would uninstall the driver too. But you can delete or rename gnetmous.exe file if you want to use HotkeyP instead of it.

A horizontal wheel does not work on Windows XP or older.

There is option "Delay mouse buttons" in the options dialog box. It is used for shortcuts which consist of two or more buttons. HotkeyP will delay only those buttons for which some shortcut exists. For example, if you create shortcut R+L, the right button will be delayed, if you create shortcut M+R, the middle button will be delayed. If the interval between mouse buttons is longer than the "Delay mouse buttons" value, the shortcut will be executed too, but a message about buttons press will be sent to a window under the mouse cursor. For example, if you have a shortcut R+L and you wait too long between buttons R and L, the shortcut will be executed and after you release the right button, a context menu will be shown. If you want to drag&drop files with the right button, press the right button, then you must wait until the file is selected and after that you can start moving the mouse. This behavior is disabled for the left button, because drag&drop with the left button is used very often. The buttons delay is not convenient for games, so there is option to disable it for some applications. Write exe file names without paths to the edit box, separate them by semicolons.

Remote control

Hotkeys can be defined for a remote control buttons, too. You have to install the WinLIRC (http://winlirc.sourceforge.net). After you install and configure WinLIRC, go to HotkeyP options, set path to winlirc.exe and check Enable.

Categories

It is convenient to classify your hotkeys, especially if you have many hotkeys. There is a category panel at the left side of the HotkeyP window. Some categories are created automatically and cannot be modified (these categories are: keyboard, mouse, joystick, remote, commands, programs, documents, web links, autorun, tray menu). Besides them you can create your own categories. Select hotkeys which will be in a new category, then choose command "Assign to selected hotkeys" from the menu Category, write name of the new category and click OK. The command "Assign to selected hotkeys" is used not only for creating new categories, but also to move hotkeys from one category to another, just choose some existing category from the dropdown list. If you leave the category name empty, selected hotkeys will be moved to the category "default". If you delete a category, all hotkeys from that category will be moved to default category.

Hook

Hook is a procedure that is called whenever a key is pressed. You can disable the hook in the options, but then some multimedia keys (which are displayed as number in brackets) will not work and you will not be able to set hotkeys for CapsLock and Win+M, Win+E, Win+R etc. The hook is also required for "Macro" and "Paste text" commands to work properly. If you check option "Use keyboard hook for all hotkeys", the hotkeys will work in games and other DirectX applications too.

The hook doesn't work in applications which are running as administrator unless the HotkeyP is running as administrator too.

Internal commands

Most commands have some parameters which are usually optional. Parameters are separated by a space.

Internal commands can be executed not only by hotkeys, but also from the command line. For example, the computer can be restarted by command hotkeyp -reboot. It is useful in scripts or BAT files. They can be used in schedulers or you can put them to the startup group. If you use more than one command after hotkeyp on the command line, separate them by semicolons.

Shutdown, Reboot, Logoff

Parameter:
0 - normal shutdown
1 - forced shutdown, all unsaved data will be lost
2 - safe shutdown, all windows will be closed before shutdown

Sleep/Suspend, Hibernate

WARNING! Hibernation does not work if it is not enabled in Control Panel\Power options.

Show shutdown dialog

Same as if you click on the "Start" button and choose Shutdown...

Lock computer

Parameter is a text that can contain special % sequences for date/time, user name, etc. See Paste text command for more details. If you don't want any text, use a space as parameter. After you create this hotkey, dialog window for a password will be shown. The password can consist of any keys except Enter, Escape, Backspace, Tab, Alt. The password cannot be longer than 64 keys.
If the parameter is empty, the command will call the standard system function to lock the computer and it will accept only your login password.

Disk free space

Shows free space of all fixed and network drives. Parameter specifies the time, in milliseconds, for which to show the popup window. The window also disappears after you press the hot key again. The window can be moved by a mouse.

Remove drive

Safely removes a drive from the system. There must NOT be any file or folder opened on that drive. Parameter is a drive letter. If you run this command without parameters, then all USB drives will be removed.

Empty recycle bin

Parameter is sum of these options (default is 0):
1 - no confirmation
2 - no progress window
4 - no sound

Clear recent documents

Deletes all items in the Start submenu Documents. Only shortcuts will be deleted, not your documents.

Delete temporary files

Deletes files in the TEMP folder which are older than 7 days (or which are older than the parameter). It compares both modification dates and creation dates.

Control panels

Parameter can by a name of *.CPL file without path and without extension.

Disable key

Parameter is one or more keys that will be blocked/unblocked every time the hotkey is pressed. See command Macro for a key names list. The most usual parameter is \win. The Win key is between Ctrl and Alt keys which are often used in games and a fullscreen game is interrupted when you accidentally press the Win key.
This function is used to temporary disable a key. If you want to disable some key permanently, create a keyboard shortcut for that key, for example command Macro with an empty parameter.

Hide tray icon

Hides a small icon in the system tray. The first parameter is an icon identification number. The second parameter is window which has created the icon. These information can be found by spy.exe. Just click by the left mouse button on some tray icon and the icon number and window process/class/title will be shown in the Spy window.

Restore tray icon

Shows an icon which has been previously hidden by a command Hide tray icon. Parameters are the icon number and its window name.

Start service

Runs a system service. The parameter is a service short name (not a visible name or description). The name can be found if you open the service list (in This computer / Manage) and then double-click an item in the list.
This function works only if the HotkeyP is running as administrator.

Stop service

Parameter is a service name, see Start service for more details.
This function works only if the HotkeyP is running as administrator.

Screen saver

Runs screen saver which is selected in the desktop properties.

Display power off

Switches a display to power saving mode.
Parameter (for CRT monitors, useless for LCD):
1 - less saving mode, fast restore
2 - more saving mode, slow restore

Desktop resolution

Parameters are width, height, colors, frequency, display number. These numbers have to be separated by spaces. Width and height are measured in pixels. Colors can be 8,16,24 or 32. The fifth parameter is needed only if you have more than one display. This command can also be used to switch between two resolutions.
Example: 1280 1024 16 60, 1024 768 32 75
Be careful. Use only resolutions that are supported by your display.

Show desktop

It is the same as Win+D.

Desktop snapshot

It is similar to PrintScreen, but a captured image is saved to BMP file.

Random wallpaper, Next wallpaper, Previous wallpaper

Parameter is a folder or a BMP, JPG or GIF file. If it is a folder, all subfolders are searched to choose one picture which is set as desktop wallpaper. If you have JPG or GIF wallpapers, you must enable Active desktop. (Right-click on the desktop and check 'Show web content').
The command "Random wallpaper" chooses a file randomly. Commands "Next wallpaper" or "Previous wallpaper" select next/previous file in a folder according to how the files are stored on your hard disk.

Save desktop icons

Remembers positions of all icons on the desktop. (They are saved in the registry).
This function does not work on 64-bit Windows.

Restore desktop icons

Restores desktop icon positions to the situation when you last executed command Save desktop icons.
This function does not work on 64-bit Windows.

Magnifier

This function has 3 parameters, but all are optional. The first integer parameter is the zoom. The second parameter is window width, the third parameter is window height. The magnifier window is shown instead of the mouse pointer. It disappears after you press this hotkey again or after you press some mouse button.
Warning: Magnifier window is refreshed only during mouse movement. If you don't move the mouse, you will see a still picture.

Show text

The second parameter is a text that will be displayed in a popup window. The first optional parameter means how long is window visible (in milliseconds). The window also disappears after you press the hot key again. The window can be moved by a mouse. The text can contain special % sequences, see Paste text command for more details.

Minimize window, Maximize window, Close window, Always on top

Minimizes, maximizes, closes window or changes always on top property. Parameter is a window name. That means a window title, a window title substring, a window class, or an executable file name without a path. If the parameter is omitted, these functions work with the currently active window.

Maximize all

Maximizes all windows.

Minimize others

Minimize all windows except a currently foreground window.

Minimize to tray

It hides all windows of an active application and creates a small icon in the notification area of system tray. If you click the tray icon, the application will be restored and the icon will disappear.

Minimize window to tray

It hides an active window and creates a small icon in the notification area of system tray. If you click the tray icon, the window will be restored and the icon will disappear.

Hide window

Hides or unhides a window. Parameter is window name. If the parameter is empty, this function works with the currently active window.
You can set the parameter to Shell_TrayWnd to hide system tray. If you want to hide desktop icons, set the parameter to Program Manager.

Hide application

This function is similar to Hide window, but it hides all windows of the active application. If you press the hotkey again, all previously hidden windows are restored.

Resize window, Move window

It is used to resize or move a window by cursor keys. You have to press Enter key after you finish resizing or moving.

Window snapshot

It is similar to Alt+PrintScreen, but a captured image is saved to BMP file.

Opacity

The first parameter is an integer from 0 to 255 that means from transparent to opaque. The second optional parameter is a window.

Opacity -, Opacity +

Increases or decreases window opacity. The first optional parameter is an integer which means how much the opacity is changed (default value is 10). The second optional parameter specifies a window.
This function requires Windows XP or later.

Information

Shows title, class, process, priority of a foreground window. On Win2000/XP also shows memory allocated for that process.

Terminate process

Use this command to kill foreground application only if the application is not responding.
Optional parameter is a name of application which you want to terminate.

Process priority

Sets process priority of an active window. Real-time priority can be used only if the HotkeyP is running as administrator.

Next task, Previous task

This is the same as Alt+Tab or Alt+Shift+Tab. It works only on Windows NT/2000/XP and only with mouse shortcuts, e.g. the fourth mouse button + wheel.

Volume, Volume +, Volume -

This command sets or increases or decreases audio volume. The first parameter is percent (an integer from 0 to 100). The second parameter is an audio line name (Mixer, Wave, MIDI, CD Audio, Line In, Microphone, Bass, Treble, ...). Actual names depend on your sound card and you can see them in the Volume Control application in Windows accessories. The Mixer is synonym for the default output volume. If you want to change recording volume, add prefix R: to the audio line name (for example R:Microphone).

If you have more than one sound card, write number and colon before audio line name on Windows 2000/XP (for example 2:Mixer), or append one space and sound card name in parenthesis on Windows Vista/7/8/10 (for example Speakers (Creative SB X-Fi)).

The "Show these audio lines:" edit box in the options dialog box contains comma-separated audio line names that are displayed every time this hotkey is pressed. There can be a display name and equals sign before an audio line name (for example Volume=Mixer,Record=R:Microphone ).

Mute

Disables or enables an audio line. The parameter is an audio line name (Mixer, Wave, MIDI, CD Audio, Line In, Microphone, ...).

Eject/Close CD

Ejects or closes door of the CD or DVD drive. Optional parameter is the drive letter.
NOTE: If this command only ejects CD, but cannot close it, then you have to create two different hotkeys for commands Eject CD and Close CD. These commands are not in the drop-down menu, so you must write them manually into the Command edit box.

Play CD, Stop, Next track, Previous track

Plays audio CD. Other programs for playing CD must not be running. Optional parameter is the drive letter.

CD speed

The first parameter is speed (10, 16, 24, 32, 40 etc.). The second parameter is drive letter.

Paste text

Parameter is a text that is pasted to an active window through the clipboard by Ctrl+V. You can specify multiple texts separated by %|. In that case, pressing the hotkey will display a listbox and then you will choose an item by double-click or by pressing key down and Enter. For example, parameter ab%|cdef%|ghi leads to a popup window which has 3 rows: ab, cdef, ghi. The popup window can be canceled by the Esc key.
The text can contain some special sequences: %r - end of line, %u - user name, %o - computer name, %l - plain text from the clipboard, %% - percent sign, %x - date, %X - time, %c - date and time, %d - day, %m - month, %Y - year, %y - year without century, %H - hour [0-23], %I - hour [1-12], %p - AM/PM, %M - minute, %S - second, %A - weekday name, %a - abbreviated weekday name, %B - month name, %b - abbreviated month name, %#d - day without leading zeros, similarly %#m, %#H, %#I, %#M, %#S

Macro

Parameter is a text string which can contain sequences \esc, \tab, \backspace, \enter, \space, \left, \right, \up, \down, \ins, \del, \home, \end, \pageup, \pagedown, \f1, \f2, ..., \shift, \rshift, \ctrl, \rctrl, \alt, \ralt, \win, \rwin, \apps, \capslock, \scrolllock, \numlock, \pause, \printscreen, \divide, \multiply, \add, \subtract, \decimal, \0, \1, ..., \num0, \num1, ..., \A, \B, ..., \back, \forward, \refresh, \search, \favorites, \browser, \mail, \power, \volume_down, \volume_up, \mute, \play_pause, \stop, \prev_track, \next_track, \media_select, \launch_app1, \launch_app2, \lbutton, \rbutton, \mbutton, \xbutton1, \xbutton2, \wheelup, \wheeldown, \wheelleft, \wheelright, \doubleclick, \sleep, \rep, \xAB.
There can be a dot after every special sequence. If you only want to press down or to release a key, use suffix down or up. It is useful for combinations of two or more keys or buttons. For example \lbuttondown\rbutton\lbuttonup means mouse buttons L+R. Keys shift, ctrl, alt, win remain pressed together with the next character. For example \shift.a\shift.b is the same as \shiftdown.a\shiftup\shiftdown.b\shiftup and this is the same as AB. The ctrl key can be written as \^ .
Macros \A \B \C etc. work with any keyboard layout (e.g. Russian or Greek) and can be used for shortcuts like \ctrl\C or \ctrl\V. If you use letters a b c or A B C, it will work only if the current language has Roman alphabet (Latin). It will also hold shift key for uppercase (or lowercase if the Caps Lock is active). Similarly, macros \1 \2 \3 etc. don't depend on the keyboard layout.
There is a number after \sleep command which means delay in tenth of a second.
There are two hexadecimal digits after \x sequence which mean a virtual key code.
If you have set the option never use the keyboard hook, then a macro will NOT be repeated while you hold down a hotkey for a while. If you still want a macro to be repeated, prepend sequence \rep to the macro parameter. It has a drawback - shifts will remain pressed if you release them too quickly.

Macro to active window

The first parameter is like Macro parameter. The second parameter denotes a window. If this window is not in foreground, this command is not executed. The second parameter can contain characters &, |, ! which mean logical operators and, or, not. There must not be a space before or after these operators. Operator & has higher priority than |. You can use parenthesis to make more complex expressions. The window name must be written in apostrophes if it contains special characters & | ! ( ). If there is a space character in the window name, the entire second parameter must be written in quotation marks. For example "window 1"|"window 2" is error, it should be "window 1|window 2".
If you choose the option "Use hook for all hotkeys", a keydown event will be simulated when you press a "Macro to active window" hotkey and a keyup event will be simulated when you release this hotkey. If you disable the keyboard hook, then both keydown and keyup events will be simulated when you press this hotkey and nothing will happen when you release this hotkey.

Send keys to window

Sends messages WM_KEYDOWN and then WM_KEYUP. The first parameter is a macro. The second parameter determines a window. This window is activated if the first parameter starts with \show. This command doesn't work for minimized windows. Some applications require three parameters: keys, EXE name, window class or title. If you specify only EXE name, it might not work for applications which have more than one window. If you specify only window class or window title and there are more applications that have that window, the keys are sent randomly to one application.

Keys to active window

This command is similar to "Send keys to window", but it is ignored when the window determined by the second parameter is not in foreground. It can be used to change keyboard or mouse accelerators of almost any application. The third optional parameter determines the window to which the keys are sent. This window needn't have keyboard focus, but must belong to the foreground application.

Send window command

Sends message WM_COMMAND to another window. The first parameter is a command number. Numbers can be found by spy.exe. Unfortunately, it does not work for all applications (e.g. programs written in Java or .Net Framework or programs which have Unix user interface). The second and the third parameters determine a window, similarly to command "Send keys to window".

Windows Media Player 9
18808 - play/pause, 18809 - stop, 18810 - previous, 18811 - next

Tiny Player
264 - play/pause, 204 - stop, 227 - previous, 228 - next, 255 - stop after current

Winamp
40044 - previous, 40045 - play, 40046 - pause, 40047 - stop, 40157 - stop after current, 40048 - next, 40022 - repeat, 40023 - shuffle, 40029 open, 40040 playlist, 40061 - back, 40060 - forward

Command to active window

This command is similar to "Send window command", but it is ignored when the window determined by the second parameter is not in foreground. The command is sent to a window which is determined by the third optional parameter. Example for player Winamp: the second parameter must be winamp.exe, the third parameter must be "Winamp v1.x".

Multi command

It is used to assign a hotkey to execute more than one program or internal command. Parameters are numbers of previously created hotkeys.

Commands list

Parameters are similar to Multi command, but only the first parameter is executed when this hotkey is pressed. After that, the first number is moved to the end of parameters list. So you have to repeat pressing the hotkey to execute all items in the list.

Move mouse cursor

Two parameters are relative coordinates of mouse movement. They must be separated by a space. If parameters are empty, mouse cursor is moved to the center of the screen.

Wheel

Simulation of a mouse wheel. Parameter is amount of wheel movement. Value 120 means elementary rotation up, value -120 means rotation down.

Horizontal wheel

Simulation of a horizontal mouse wheel. Parameter is amount of wheel movement. Value 120 means elementary rotation right, value -120 means rotation left.
This function does not work on Windows XP or older.

Left click, Middle click, Right click, Fourth button click, Fifth button click

Simulation of mouse button press.

Double click

Simulation of two left button clicks. Note: this command does not release shift keys.

Show HotkeyP window

Activates the HotkeyP main window. This command is same as clicking on the HotkeyP icon in the system notification area.

Disable all hotkeys

Parameter 1 means disable, 0 means enable, empty parameter means toggle. It disables all keyboard and mouse shortcuts (except command "Disable all hotkeys"). It is useful especially for games.

Disable keyboard shortcuts

It disables all keyboard shortcuts (within the HotkeyP application), but the keyboard hook will still be active. Parameter 1 means disable, 0 means enable, empty parameter means toggle.

Disable mouse shortcuts

It disables mouse shortcuts and uninstalls the mouse hook. Parameter 1 means disable, 0 means enable, empty parameter means toggle.

Disable joystick shortcuts

It disables joystick shortcuts and also suspends the thread which every 10 ms reads data from a joystick. Parameter 1 means disable, 0 means enable, empty parameter means toggle.

Disable remote control

It disables remote control shortcuts, but it does not disconnect from WinLIRC. If you also want to close a connection to WinLIRC, you have to uncheck the option "Enable" which is on the "Mouse/Remote" options tab. The Parameter 1 means disable, 0 means enable, empty parameter means toggle.

Reload hook

This command is useful if you have multiple keyboard applications installed and the other application captures keyboard input and does not forward keystrokes to the HotkeyP. If some keyboard shortcuts stop working in HotkeyP, you can use this command to repair it.

Run HotkeyP as administrator

You can skip this chapter if you have Windows XP or older or if you have disabled the User account control.
If you use some applications which require administrator rights, you need run HotkeyP as administrator too. Otherwise some keyboard shortcuts and HotkeyP commands would not work (especially macro and paste text). If you want to start HotkeyP automatically at Windows startup, you have to create a task.
  • Find the Command prompt in the Start menu, click the right mouse button and select Run as administrator.
  • Copy this command and paste it into the command prompt (replace Program Files by path where the HotkeyP is installed):
    schtasks.exe /create /sc onlogon /tn HotkeyP /rl highest /tr "'C:\Program Files (x86)\HotkeyP\HotkeyP.exe' 0" /f
  • Start the Task scheduler.
  • Select "Task scheduler library" in the left panel. Then double-click the HotkeyP task to show its properties.
  • Click on the Settings tab and disable the option "Stop the task if it runs longer than 3 days". Then click OK and close the task scheduler window.
  • Start HotkeyP and disable option "Start automatically at Windows startup".

License

This program is distributed under the terms of "GNU General Public License". You can get it from the author's web page or from http://opensource.org/licenses. Here is only a short abstract of this license:
  1. The Program is free. You may distribute it in any medium. There can be other programs (free or commercial) on the same medium.
  2. You may modify the Program and you may incorporate parts of the Program into your programs. In both cases, you may distribute modified or derived versions only if you also meet all of these conditions:
    1. You must not remove or alter this license.
    2. You must not delete the original author's name.
    3. You write documentation of all changes and the date of any change.
    4. You will make the derived source code available via FTP or HTTP.
  3. The Program is provided without warranty.