Monday, December 1, 2014

windows - AutoHotkey Keyboard Shortcuts Not Captured When Certain Programs Are Focused


I have a very simple AutoHotkey script that listens for certain key presses to run Windows Shortcut files (lnk):


F21::
Run "C:\Users\djcim\Google Drive\Powershell Scripts\Admin Shortcuts\djcim\StartOBS.lnk"
Return
F22::
Run "C:\Users\djcim\Google Drive\Powershell Scripts\Admin Shortcuts\djcim\StopOBS.lnk"
Return

It seems to capture the key presses in most situations, however when I have certain programs focused like OBS or VSCode nothing happens.


Are these programs somehow blocking AutoHotkey from capturing these key presses? I have verified that neither of these programs are using F21 or F22 for shortcuts in program.


Answer



I am sure you meant F11 and F12.


If you are running an application with admin privileges, and at the same time, if AHK is running with lower privileges, then AHK won't intercept the key presses, and that could very well be the reason behind the problem you have described.


And if that is the case, the solution is to run the AHK script with the same privileges as other applications that you have mentioned.


More here:


https://stackoverflow.com/questions/1890351/why-is-visual-studio-catching-key-events-before-autohotkey


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...