當 VS2012 處於活動視窗時,AutoHotkey 不會擷取擊鍵

當 VS2012 處於活動視窗時,AutoHotkey 不會擷取擊鍵

當 Visual Studio 2012 在我的新 Windows 8 電腦上為活動視窗時(並且僅當 Visual Studio 為活動視窗時),AutoHotkey 不會擷取擊鍵。我在 Windows 7 上使用 VS2010 沒有遇到這個問題。

如何讓 AutoHotkey 優先於 VS2012?

以下是 .ahk 檔案中的腳本:

;;;; Spotify! ;;;;

SetTitleMatchMode 2 

; "WindowKey + F11"  for previous 
#F11::
DetectHiddenWindows, On 
ControlSend, ahk_parent, ^{Left}, ahk_class SpotifyMainWindow 
DetectHiddenWindows, Off 
return 


; "WindowKey + F12"  for next 
#F12::
{ 
DetectHiddenWindows, On 
ControlSend, ahk_parent, ^{Right}, ahk_class SpotifyMainWindow 
DetectHiddenWindows, Off 
return 
} 

; "WindowKey + F10"  for pause
#F10::
{ 
DetectHiddenWindows, On 
ControlSend, ahk_parent, {space}, ahk_class SpotifyMainWindow 
DetectHiddenWindows, Off 
return 
} 

答案1

這是因為您在不同的權限等級上執行 Visual Studio 和 AutoHotKey。您很可能會以管理員身分執行 VS,但以您(登入使用者)身分執行 AHK。我建議以相同的權限等級運行它們,這樣您的問題就會得到解決。

相關內容