gpt4 book ai didi

swift - 在 Swift 中处理 cmd + q

转载 作者:行者123 更新时间:2023-11-28 06:29:25 25 4
gpt4 key购买 nike

我想使用 cmd + q 退出我的应用程序。我怎样才能触发这个?只需要执行这个:

NSApplication.shared().terminate(self)

我怎样才能获得按钮按下?

最佳答案

在 Interface Builder 中,将 Quit NSMenuItem 的操作连接到 First Responder(红色立方体)> terminate: 并分配按键命令。

关于swift - 在 Swift 中处理 cmd + q,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40784182/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com