AutoHotKey:shift rbutton Control C 麻烦

AutoHotKey:shift rbutton Control C 麻烦

我想将鼠标上的Shift+重新映射RButtonShift+ LButton。然后,在释放 时RButton,发送Ctrl+C以复制我突出显示的选择。

到目前为止,我想到最好的办法是:

+rbutton::
+lbutton
keywait rbutton
send {control c}
return

不幸的是,它没有执行Ctrl+C命令:

任何帮助都将受到赞赏。

答案1

如果您希望在按下Shift+时将文本从当前光标位置复制到鼠标位置RButton,请使用以下命令:

+RButton::
    ClipBoard = ; Clear the ClipBoard
    Send, +{lbutton} ; Send the [Shift]+[LButton]
    KeyWait, RButton ; Wait for RButton to be released
    Send, ^c ; Send [Ctrl]+c to copy the selected text to the ClipBoard
    Sleep, 50 ; ClipWait is not reliable and you need a little time for [Ctrl]+c to copy to the clipBoard.
    TrayTip, ClipBoard, %ClipBoard%, 1 ; Show the ClipBoard results
Return

相关内容