【问题标题】:Remap doesn't work by AutoHotKey except for an application除应用程序外,AutoHotKey 无法重新映射
【发布时间】:2019-09-04 05:53:41
【问题描述】:

我想使用Autohotkey 将right ctrl+a 重新映射到Home,但名为xyzzy 的应用程序除外。

这是我写的代码。

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

重映射适用于记事本等其他应用程序,但在使用 xyzzy.exe 时也会重映射。

ahk_exe 名称由AU3_Spy.exe 检查,如下图所示。

如何从密钥重新映射中排除特定应用程序?

【问题讨论】:

    标签: autohotkey


    【解决方案1】:

    试试

    #IfWinNotActive ahk_exe xyzzy.exe
    
      >^a:: Send {Home}
    
    #If
    

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

    或

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

    【讨论】:

    • 谢谢!所以我需要在制作热键时使用if directive而不是if statement。
    • 不一定,#if 指令在特定程序忽略键(- 组合)或执行某些您认为不希望的操作时很有用。请参阅编辑后的答案。
    猜你喜欢
    • 2021-09-04
    • 1970-01-01
    • 1970-01-01
    • 2011-06-14
    • 1970-01-01
    • 2011-12-11
    • 2018-12-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多