【问题标题】:Auto Hot key not working in application but working outsideAutohotkey 在应用程序中不工作但在外部工作
【发布时间】:2018-02-08 23:30:11
【问题描述】:

我有一个电子应用程序,我在其中使用自动热键。我想禁用 ALT+F4,因为我编写了以下脚本

!F4::Return

执行此脚本后,我仍然可以使用 Alt+F4 关闭我的电子应用程序,但对于记事本、文件夹等其他应用程序,脚本工作正常。

供参考:https://www.autohotkey.com/docs/AutoHotkey.htm

【问题讨论】:

标签: node.js electron autohotkey


【解决方案1】:

这对标题中带有“-记事本”的所有窗口禁用了 Alt+F4

SetTitleMatchMode 2     ; All #If statements match anywhere in title

#IfWinActive - Notepad
!F4::return
#IfWinActive

- Notepad 替换为您的 Electron 应用程序窗口的标题

【讨论】:

    【解决方案2】:

    我认为你最好在浏览器窗口选项中设置closable: false,这样电子窗口就不会关闭,其他窗口也不会关闭。

    All browser window options

    【讨论】:

      猜你喜欢
      • 2017-07-15
      • 2014-11-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-07-24
      • 2016-09-16
      • 2021-06-18
      • 1970-01-01
      相关资源
      最近更新 更多