I'm a longtime Windows user who really likes to customize his Windows with lots of different utilities (some written by myself in Python) and AutoHotKey scripts. These all use global hotkeys for their functionality.
I was recently forced to upgrade to Windows 10. One of the problems has been that some hotkeys seem to be impossible to bind to. A couple of examples are CTRL-J
and CTRL-V
.
I was told that I needed to mark these apps to run as administrator via Properties, but even then they don't bind successfully to these hotkeys.
Any idea how I could bind to these hotkeys?
Update:
Looks like AHK is able to bind to these keys, but the ever-useful Ditto isn't, and my wxPython programs aren't either. Any idea why the last 2 aren't able to bind to these keys, and how I can fix that?
AutoHotkey implements keyboard hotkeys basically one of two ways:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With