【问题标题】:Closing a window using key combinations使用组合键关闭窗口
【发布时间】:2015-12-03 14:22:18
【问题描述】:

我已经映射了以下键:

ALT + Z to be equivalent to ALT + F4
ALT + X to be equivalent to ALT + F + C

使用以下代码:

!z::
   Send, !{F4}
!x::
   Send, !fc

但是,当这段代码正在运行并且我按下 ALT + Z 时,实际发送的键是:

ALT + F4 然后ALT + F + C 而不是ALT + F4

我做错了什么?如何让 ALT+Z 的映射正确?

【问题讨论】:

标签: autohotkey


【解决方案1】:

您需要一个return 语句来告诉脚本停止执行

!z::
   Send, !{F4}
return

!x::
   Send, !fc
return

【讨论】:

    【解决方案2】:

    这是一个适合我的 AutoIt 解决方案。

    HotKeySet("!z", "sendKeys")
    
    ; Run Notepad just to have something to test with.
    Run("notepad.exe", "", @SW_SHOWMAXIMIZED)
    
    While 1
        Sleep(100)
    WEnd
    
    Func sendKeys()
        Send("!{f4}")
        Exit
    EndFunc   ;==>sendKeys
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-16
      • 1970-01-01
      • 1970-01-01
      • 2011-06-29
      • 1970-01-01
      相关资源
      最近更新 更多