Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like to remap Shift+RButton to Shift+LButton on the mouse. Then, at the release of RButton, send Ctrl+C in order to copy my highlighted selection.

So far, the best I have come up with is this:

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

Unfortunately, it does not perform the Ctrl+C command:

Any help is appreciated.

share|improve this question

migrated from stackoverflow.com Apr 3 '13 at 9:17

This question came from our site for professional and enthusiast programmers.

    
I think this would be more appropriate on Superuser that on SO. –  Joce Apr 2 '13 at 17:00

1 Answer 1

If you are looking to copy text from the current cursor location up to the mouse location when you press Shift+RButton, then use this:

+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
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.