啊!无法使 "Ctrl+Q then K" 输入工作(Q-Dir 工具中的快捷方式)
AHK! Can't get "Ctrl+Q then K" Input to work (Shortcut in Q-Dir tool)
背景:
所以我使用资源管理器工具Q-Dir(link到主页)。
在 Q-Dir 中,您可以将要定期访问的文件夹添加为书签。
您可以通过按 Ctrl + Q 快捷方式访问这些书签。这将打开您的书签文件夹的跳转列表。
所以我想打开名为 "Kundenprojekte" 的项目文件夹(客户项目)。
在所述跳转列表打开时按 "K",将在当前选项卡中打开此文件夹。
所以我的问题出现在这里:
这整个过程就是我想用AHK映射的,比方说WinKey + B。
到目前为止,这是我的代码:
#b::
qdirId := WinExist("Q-Dir 5.98.9") ; I don't know if this works I got some
; inspiration by another AHK script
if (qdirId = 0) {
MsgBox Q-Dir ist nicht geöffnet. ; Q-Dir is not open.
IfWinExist, "Q-Dir 5.98.9"
{
WinActivate, "Q-Dir 5.98.9" ;I know this doesn't work plz help
SetKeyDelay 10,1000
Send, ^{Q}
SetKeyDelay, 10
Send {K}
return
}
}
return
是的,目前还没有 "else" 到 IfWinExist。而且我不认为会有,因为我需要 运行 Q-Dir 作为管理员(由于 UAC 阻止对我的 C: 驱动器进行写操作)但这无关紧要(因为我通常启动 Q- Dir 作为我启动后的第一个程序)。
我遇到的主要问题是让 "send Control + Q" 然后 "K" 工作。
我收到它要发送 "K" 但一次都没有被识别 "Ctrl + Q"。
知道我做错了什么吗?
提前谢谢你:)
SetTitleMatchMode, 2 ; The window's title should contain "Q-Dir 5.98.9"
#b::
qdirId := WinExist("Q-Dir 5.98.9")
if (qdirId = 0)
{
MsgBox Q-Dir ist nicht geöffnet. ; Q-Dir is not open.
return ; stops code from going any further, to the lines below
}
; otherwise:
WinActivate, Q-Dir 5.98.9
WinWaitActive, Q-Dir 5.98.9 ; important
SetKeyDelay 10,1000
Send, ^{Q}
; Try also:
; Send, {CTRLDOWN}q{CTRLUP}
; SendEvent {CTRL DOWN}{q DOWN}{CTRL UP}{q Up}
SetKeyDelay, 10
Send {K}
return
背景:
所以我使用资源管理器工具Q-Dir(link到主页)。
在 Q-Dir 中,您可以将要定期访问的文件夹添加为书签。 您可以通过按 Ctrl + Q 快捷方式访问这些书签。这将打开您的书签文件夹的跳转列表。
所以我想打开名为 "Kundenprojekte" 的项目文件夹(客户项目)。 在所述跳转列表打开时按 "K",将在当前选项卡中打开此文件夹。
所以我的问题出现在这里:
这整个过程就是我想用AHK映射的,比方说WinKey + B。
到目前为止,这是我的代码:
#b::
qdirId := WinExist("Q-Dir 5.98.9") ; I don't know if this works I got some
; inspiration by another AHK script
if (qdirId = 0) {
MsgBox Q-Dir ist nicht geöffnet. ; Q-Dir is not open.
IfWinExist, "Q-Dir 5.98.9"
{
WinActivate, "Q-Dir 5.98.9" ;I know this doesn't work plz help
SetKeyDelay 10,1000
Send, ^{Q}
SetKeyDelay, 10
Send {K}
return
}
}
return
是的,目前还没有 "else" 到 IfWinExist。而且我不认为会有,因为我需要 运行 Q-Dir 作为管理员(由于 UAC 阻止对我的 C: 驱动器进行写操作)但这无关紧要(因为我通常启动 Q- Dir 作为我启动后的第一个程序)。
我遇到的主要问题是让 "send Control + Q" 然后 "K" 工作。
我收到它要发送 "K" 但一次都没有被识别 "Ctrl + Q"。
知道我做错了什么吗?
提前谢谢你:)
SetTitleMatchMode, 2 ; The window's title should contain "Q-Dir 5.98.9"
#b::
qdirId := WinExist("Q-Dir 5.98.9")
if (qdirId = 0)
{
MsgBox Q-Dir ist nicht geöffnet. ; Q-Dir is not open.
return ; stops code from going any further, to the lines below
}
; otherwise:
WinActivate, Q-Dir 5.98.9
WinWaitActive, Q-Dir 5.98.9 ; important
SetKeyDelay 10,1000
Send, ^{Q}
; Try also:
; Send, {CTRLDOWN}q{CTRLUP}
; SendEvent {CTRL DOWN}{q DOWN}{CTRL UP}{q Up}
SetKeyDelay, 10
Send {K}
return