AutoHotkey implements keyboard hotkeys basically one of two ways:
- The system function RegisterHotkey. This only supports basic combinations of standard modifier keys and one key identified by VK. It does not support conditional hotkeys (#If). If the hotkey has already been registered by the system or another application, it fails.
- If RegisterHotkey couldn't be used for some reason or it failed to register the hotkey, a keyboard hook is used. This is the means by which it overrides system hotkeys and global hotkeys of other applications.
Normally, ^j
and ^v
are not registered as global hotkeys. Most Ctrl+ combinations are used within applications, so are not good choices for global hotkeys. ^v
in particular would be a bad choice because it's often the "paste" hotkey (but not global).
When I use ^j::
or ^v::
in an AutoHotkey script on Windows 10.0.19041, ListHotkeys
shows that they use the reg
(RegisterHotkey) method. In that case, other programs should have no problem registering the hotkeys with RegisterHotkey as long as they are the first to do it. AutoHotkey does not do anything special to make RegisterHotkey work; it just calls the function, and awaits the WM_HOTKEY message.
However, if ListHotkeys
was to show that ^j
and ^v
were using the k-hook
method (in the absence of #UseHook
or #If
), that would mean something else has already registered those hotkeys. In that case, the only way to make RegisterHotkey work is to find whatever registered them (using general troubleshooting techniques like performing a clean boot), and get rid of it (or change its hotkeys if you can). For example, if you terminate explorer.exe, it is possible to register standard hotkeys like #e
with RegisterHotkey.
Alternatively, if your program implements a low level keyboard hook (the same as AutoHotkey's), it can detect the hotkey by watching for Ctrl and J or V keydown and keyup events.
The program implementing the hotkey does not need to run as administrator. However, if the active/focused window belongs to a program which is running as administrator, only other programs which run as administrator or with UI access can intercept its keyboard input.
^j::MsgBox
and^v::MsgBox
work fine for me. This is a default installation with nothing special done; that is, without having modified the properties. Some Windows hotkeys are set in the registry (such as # + L), but I don't believe the two you mentioned are. – Diarthrosis