除“^c”以外的快速复制
Express copy other than "^c"
我想在我的 ctrl+C 键中添加一些额外的步骤。基本上,在我按下 ctrl+C 后,我会 运行 一个 python 代码来处理剪贴板上的内容,并用处理过的文本更新剪贴板,以便我可以将其粘贴出来。
^x::
clipboard =
Sleep, 50
Send, ^c
ClipWait
Sleep, 50
Run "directory\try.py"
RunWait "directory\try.py"
Return
您可以看到我使用了 ^x,因为我不想让我的测试热键继续调用它自己。我仍然想使用 ^c 来触发该过程,但在那种情况下,我需要用“^c”以外的其他术语来表达 "copy"。有人可以帮我解决这个问题吗?我尝试 google 但没有找到有用的想法。谢谢。
您可以使用 ~^c::
来触发您的脚本。波浪号让密钥通过,所以你不需要单独发送它
如果您想多次单击相同的键盘快捷键,您可以执行不同的操作。
您可以使用这个 Ahk 示例。
example.ahk
#SingleInstance force
;MultiClick the Same Keyboard Shortcuts to execute with different actions
esc::exitapp
^c::
ctrl_c_count++ ;start counter
SetTimer ctrl_c_action, -2
return
ctrl_c_action:
KeyWait, Ctrl
If (ctrl_c_count = 1)
{
MsgBox, ctrl_c_action 1 ;copy to clipboard
sendinput ^{insert} ;Express copy other than "^c"!
;.... any code for action 1
ctrl_c_count := 0
}
If (ctrl_c_count = 2)
{
MsgBox, ctrl_c_action 2 ;copy to clipboard & run Python Script.
sendinput ^{insert}
sleep 150
;Run "directory\try.py"
;.... any code for action 2
ctrl_c_count := 0
}
return
我想在我的 ctrl+C 键中添加一些额外的步骤。基本上,在我按下 ctrl+C 后,我会 运行 一个 python 代码来处理剪贴板上的内容,并用处理过的文本更新剪贴板,以便我可以将其粘贴出来。
^x::
clipboard =
Sleep, 50
Send, ^c
ClipWait
Sleep, 50
Run "directory\try.py"
RunWait "directory\try.py"
Return
您可以看到我使用了 ^x,因为我不想让我的测试热键继续调用它自己。我仍然想使用 ^c 来触发该过程,但在那种情况下,我需要用“^c”以外的其他术语来表达 "copy"。有人可以帮我解决这个问题吗?我尝试 google 但没有找到有用的想法。谢谢。
您可以使用 ~^c::
来触发您的脚本。波浪号让密钥通过,所以你不需要单独发送它
如果您想多次单击相同的键盘快捷键,您可以执行不同的操作。
您可以使用这个 Ahk 示例。
example.ahk
#SingleInstance force
;MultiClick the Same Keyboard Shortcuts to execute with different actions
esc::exitapp
^c::
ctrl_c_count++ ;start counter
SetTimer ctrl_c_action, -2
return
ctrl_c_action:
KeyWait, Ctrl
If (ctrl_c_count = 1)
{
MsgBox, ctrl_c_action 1 ;copy to clipboard
sendinput ^{insert} ;Express copy other than "^c"!
;.... any code for action 1
ctrl_c_count := 0
}
If (ctrl_c_count = 2)
{
MsgBox, ctrl_c_action 2 ;copy to clipboard & run Python Script.
sendinput ^{insert}
sleep 150
;Run "directory\try.py"
;.... any code for action 2
ctrl_c_count := 0
}
return