I have an AutoHotkey script that I run in the background that binds Win-Period to pop up a main menu:
Code: Select all
;;; Win-Period: Pop up the root menu.
#.::
; Hack to try to ensure mouse focus, as described at:
; https://autohotkey.com/board/topic/101457-menu-loses-focus-ignores-keystrokes-sometimes/
Sleep 250
MouseGetPos MouseX, MouseY
MouseMove, %MouseX%, %MouseY%, 0
Menu Root, show, %MouseX% - 30, %MouseY% - 30
return
I tried using a simpler approach to popping up my menu by replacing the logic above with "Menu Root, show" but that had no effect.
This failure is intermittent, but once it starts happening, it happens 100% of the time I pop up my menu. If I close and restart my AutoHotkey script, the problem persists. This first happened to me ~2-3 months ago (on Windows 10 64-bit) and stopped happening a day or two later. It is now happening to me again on a new system using Windows 11, after my script had been working fine for nearly two months.
Any ideas what might be going on here?