简体   繁体   English

AutoHotKey代码以在按Ctrl + C两次的同时接收Ctrl + X

[英]AutoHotKey code to receive ctrl+x while pressing ctrl+c twice

AutoHotKey code to receive CTRL + X while pressing CTRL + V twice AutoHotKey代码可在按CTRL + V两次的同时接收CTRL + X

Can anyone help with this? 有人能帮忙吗?

Many thanks! 非常感谢!

Assuming we are talking about Ctrl + C , not V , and assuming you want to keep the original Ctrl + C function but also use it for Ctrl + X when pressing twice in a short time: 假设我们谈论的是Ctrl + C ,而不是V ,并假设您想保留原始的Ctrl + C功能,但也想在短时间内按下两次时将其用于Ctrl + X

#persistent
Transform, cC, Chr, 3  ; store the value of ctrlC into cC.
hotkey, $^c, ctrlC, ON  ; this is basically the same as if to say $^c::..., but only deactivable
return

ctrlC:
    hotkey, $^c, ctrlC, OFF
    input, key, M L1 T0.2
    hotkey, $^c, ctrlC, ON

    if errorlevel = timeout
        send ^c
    else if key = %cC%
        send ^x
    else
        send %key%
return

should do.. 应该做..

also see Input for further information. 另请参阅输入以获取更多信息。 I used this little hotkey-command-trick in order to temporarily disable the Ctrl + C -Hotkey, because otherwise input would not recognize the second c 我使用了这个小的热键命令技巧来暂时禁用Ctrl + C -Hotkey,因为否则input将无法识别第二个c

In this example, I set timeout to 0.2 seconds. 在此示例中,我将超时设置为0.2秒。 Change it to your convenience. 更改它以方便您使用。

About your capslock idea - sounds like a good idea to me, but anyways, we're not a code-provider network. 关于您的Capslock想法-在我看来,这是个好主意,但无论如何,我们不是代码提供者网络。 The command getKeyState should help you started. 命令getKeyState应该可以帮助您入门。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM