【问题标题】:Is there anyway to tell autohotkey that it has to work only on the desktop, and nowhere else?有没有办法告诉 autohotkey 它只能在桌面上工作,而不能在其他地方工作?
【发布时间】:2016-08-06 07:39:52
【问题描述】:

我希望 Autohotkey 能够区分我何时在桌面上,并仅在桌面上运行一组特定的快捷方式,并在我不在桌面上时暂停这些快捷方式。反正有这样做吗?我在 Windows 10 机器上工作。

如果我的语言不是很清楚,我附上了一张简单的图。

【问题讨论】:

标签: windows keyboard-shortcuts autohotkey


【解决方案1】:

一些想法:
检查活动窗口的循环。
仅在 Desktop 处于活动状态时才有效的上下文相关热键。

Loop
{
WinGetClass, vWinClass, A

if vWinClass in Progman,WorkerW
{
;do this
}
else
{
;do that
}

Sleep 5000
}

;==================================================

GroupAdd, vGroupDesktop, ahk_class Progman ;desktop
GroupAdd, vGroupDesktop, ahk_class WorkerW ;desktop

#IfWinActive, ahk_group vGroupDesktop
^q::
;do this
Return
#IfWinActive

注意:
同时运行两个单独的脚本可能是一个值得考虑的想法。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-10-24
    • 2021-10-02
    • 1970-01-01
    • 2018-01-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-01
    相关资源
    最近更新 更多