문제

I have a fairly simple autohotkey script that starts and stops music playback when I press one of the XButtons on my mouse: XButton1::Send {Media_Play_Pause}. The program works just perfectly and I have no problems with it. However, when I'm using Notepad++, it intercepts the mouse button hotkey before AutoHotKey does and switches tabs. This forces me to switch away from Notepad++ when I want to use this hotkey.

Is there any way I can change the order in which programs intercept hotkeys so that AutoHotKey always gets first dibs on any entered keystrokes or mouse buttons?

Or, is there a setting I can change in Notepadd++ to turn off the XButton functionality. I looked through all the settings, but I couldn't find anyway to stop this.

도움이 되었습니까?

해결책

Okay. I think I managed to figure it out. The problem was that I was running Notepad++ as an administrator, so I guess it got higher precedence in the hotkey selection. Running AHK as an admin as well solved the problem.

다른 팁

In notepad++, you can go to settings > shortcut mapper...

If your X buttons are simulating keystrokes you might have to remove the equivalent keyboard shortcut.

I had a similar problem with RDP windows.

Whenever the RDP window was active, it would intercept all key presses and my script would get nothing.

I solved this problem by having the script check every 10 seconds if the active window is an RDP window and if it is, the script reloads.

If you have variables that you need to keep, you can store them in an INI file or as global variables (either solution will slow your script down a bit).

This is not a perfect solution, because your hot-keys will not respond right away if you just opened Notepad++.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top