Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have some autohotkey settings for my joystick that are set to work everywhere.

However, there are two programs in which I don't want the joystick remapped.

How can I modify my script to prevent autohotkey from remapping the joystick in these programs, so that I don't have to manually do it?

share|improve this question

Make a couple of context-sensitive exceptions that remap your key(s) to their default setting for those two programs.

Right-click the AutoHotkey icon in your taskbar and select AutoHotkey's Window Spy to find the ahk_class of the programs you wish to ignore. The ahk_class of the active window shows in the Window Title & Class section at the top of the Window Spy.

If you have the z key remapped in the rest of your system (for example), add the following code to map it back to z in a certain app only (Notepad in this example).

#IfWinActive ahk_class Notepad ; turns on context sensitivity 
z::z ; this just maps z to itself
#IfWinActive ; turns back off context sensitivity 

More info on AutoHotkey website regarding context sensitive hotkeys:

share|improve this answer

Your Answer


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.