Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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: http://www.autohotkey.com/docs/commands/_IfWinActive.htm

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .