1
votes

I want to remap right ctrl+a to Home by using Autohotkey except an application named xyzzy.

This is the code I wrote.

if not WinActive("ahk_exe xyzzy.exe")
  >^a::Home

The remap works with other application like Notepad, but also remaps when using xyzzy.exe.

ahk_exe name is checked by AU3_Spy.exe as the image below.

enter image description here

How can I exclude specific application from key remapping?

1

1 Answers

3
votes

Try

#IfWinNotActive ahk_exe xyzzy.exe

  >^a:: Send {Home}

#If

https://www.autohotkey.com/docs/commands/_IfWinActive.htm

or

>^a::
    If !WinActive("ahk_exe xyzzy.exe") ; "!" means "NOT" in this case
    Send {Home}
return