Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When Visual Studio 2012 is active window (and only when Visual Studio is the active window) on my new Windows 8 machine, AutoHotkey does not capture keystrokes. I did not have this problem with VS2010 on Windows 7.

How can I have AutoHotkey take precedence over VS2012?

Here is the script from the .ahk file:

;;;; 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 
} 
share|improve this question
    
Do the keystrokes get captured when not in VS? Is the script running as admin? Post your code. –  Elliot DeNolf Jan 4 '13 at 20:59
    
They do get captured when not in VS. Don't have my code at the moment but will update question soon. –  GaTechThomas Jan 7 '13 at 16:40
    
I think that this is a "generic" Microsoft problem. I know of someone who can't swap the [Ctrl] and [Alt] keys because I.E. captures the keystrokes even before the scancodes. So when the [Ctrl] and [Alt] keys are swapped it works for every application EXCEPT I.E. Seems that VS2010 has the same problem. Curious though how this seemed to work in Windows 7. –  Robert Ilbrink Mar 18 '13 at 12:04
    
B.t.w. is this for every key or just the [F1]...[F12] keys? –  Robert Ilbrink Mar 18 '13 at 12:06
1  
@GaTechThomas Good research! Shame that VS2012 seems to be misbehaving. –  Robert Ilbrink Mar 21 '13 at 2:19

1 Answer 1

It is because your running Visual Studio and AutoHotKey on different permission levels. You are most likely running VS as Admin but running AHK as you (the logged in user). I suggest running them both at the same permission level, and your problem will be fixed.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.