From the Help File
Quote:
Normally, the windows API function RegisterHotkey() is used to implement a keyboard hotkey whenever possible. However, the responsiveness of hotkeys might be better under some conditions if the keyboard hook is used instead.
Turning this directive ON is equivalent to using the $ prefix in the definition of each affected hotkey. The exception to this is Windows 95/98/Me, upon which #UseHook is ignored (though the $ prefix works in a limited fashion).
As with all # directives -- which are processed only once when the script is launched -- #UseHook should not be positioned in the script as though it were a command (that is, it is not necessary to have it contained within a subroutine). Instead, position it immediately before the first hotkey label you wish to have affected by it.
Hotkeys that use the keyboard hook cannot be triggered by means of the Send command. Similarly, mouse hotkeys cannot be triggered by commands such as Click because all mouse hotkeys use the mouse hook. To work around this, use Gosub to jump directly to the hotkey's subroutine. For example: Gosub #LButton
If this directive does not appear in the script at all, it will behave as though set to OFF.
Also
Quote:
The keyboard hook monitors keystrokes for the purpose of activating hotstrings and any keyboard hotkeys not supported by RegisterHotkey (which is a function built into the operating system). It also supports a few other features such as the Input command.
The keyboard hook is not supported under Windows 95/98/Me because those operating systems require a different type of hook that must reside in a DLL file.
AutoHotkey does not install the keyboard and mouse hooks unconditionally because together they consume at least 500 KB of memory. Therefore, the keyboard hook is normally installed only when the script contains one of the following: 1) hotstrings; 2) one or more hotkeys that require the keyboard hook (most do not); 3) SetCaps/Scroll/Numlock AlwaysOn/AlwaysOff; 4) the Input command, for which the hook is installed upon first actual use.
By contrast, the #InstallKeybdHook directive will unconditionally install the keyboard hook, which might be useful to allow KeyHistory to display the last 20 keystrokes (for debugging purposes), or to avoid the need for #HotkeyModifierTimeout.
You can determine whether a script is using the hook via the KeyHistory command or menu item. You can determine which hotkeys are using the hook via the ListHotkeys command or menu item.
This directive also makes a script persistent, meaning that ExitApp should be used to terminate it.
So it basically boils down to - There are some commands and hotkeys that won't work using the built in, Windows API function RegisterHotkey() so use #UseHook to forcefully install the more adavanced hook which will allow the commands.
The advanced Hook isn't in by default as it uses up more memory.