This tutorial explains how to automatically copy selected text to clipboard in Windows 10. Essentially, you only need to select a text, and it will be automatically copied to clipboard (without using any Copy option or Ctrl+C keys).
Although copying a text is pretty easy, but when copying process is too frequent, then it might be useful to have an option to just select a text and it automatically gets copied to clipboard. For that, two different methods are covered in this tutorial. These methods work on almost all the applications (like text editor software, MS Word, Wordpad, browsers etc.). These methods also work when you select some files or folders. Those are also copied to clipboard automatically and then you can paste them in some other folder.
The first method includes a script and a free software and the second method comes with only a simple software. You can select the method which is convenient for you and use that.
Let’s start with first option.
Method 1: Automatically Copy Selected Text To Clipboard In Windows 10 Using A Script and Free AutoHotkey Software
AutoHotkey is a very popular software which is used to automate different types of tasks, create hotkeys and remap keyboard keys, etc. You can also use this software to automatically copy selected text to clipboard. For this, you need to create a script and take the help of this software to run that script. The script works whenever you select the text, use shift + arrow keys to select the text, triple or double-click on text. No matter whether you are using browser, MS Word, Sticky Notes or some other application, it will automatically copy the selected text.
Step 1: First of all, you need to download and install this software from the link above. Portable version is also available of this software.
Step 2: Right-click on an empty area on desktop → New → AutoHotkey Script. This will add a script file on the desktop. You have to rename it with any name you want. However, make sure the script extension must be “ahk“.
Step 3: Edit the newly created script. Right-click the script file and select Edit Script option. It will open the script in Notepad.
Step 4: Paste the following code and save the script.
;Auto copy clipboard
~Lshift::
TimeButtonDown = %A_TickCount%
; Wait for it to be released
Loop
{
Sleep 10
GetKeyState, LshiftState, Lshift, P
if LshiftState = U ; Button has been released.
break
elapsed = %A_TickCount%
elapsed -= %TimeButtonDown%
if elapsed > 200 ; Button was held down long enough
{
x0 = A_CaretX
y0 = A_CaretY
Loop
{
Sleep 20 ; yield time to others
GetKeyState keystate, Lshift
IfEqual keystate, U, {
x = A_CaretX
y = A_CaretY
break
}
}
if (x-x0 > 5 or x-x0 < -5 or y-y0 > 5 or y-y0 < -5)
{ ; Caret has moved
clip0 := ClipBoardAll ; save old clipboard
;ClipBoard =
Send ^c ; selection -> clipboard
ClipWait 1, 1 ; restore clipboard if no data
IfEqual ClipBoard,, SetEnv ClipBoard, %clip0%
}
return
}
}
~LButton::
MouseGetPos, xx
TimeButtonDown = %A_TickCount%
; Wait for it to be released
Loop
{
Sleep 10
GetKeyState, LButtonState, LButton, P
if LButtonState = U ; Button has been released.
{
If WinActive("Crimson Editor") and (xx < 25) ; Single Click in the Selection Area of CE
{
Send, ^c
return
}
break
}
elapsed = %A_TickCount%
elapsed -= %TimeButtonDown%
if elapsed > 200 ; Button was held down too long, so assume it's not a double-click.
{
MouseGetPos x0, y0 ; save start mouse position
Loop
{
Sleep 20 ; yield time to others
GetKeyState keystate, LButton
IfEqual keystate, U, {
MouseGetPos x, y ; position when button released
break
}
}
if (x-x0 > 5 or x-x0 < -5 or y-y0 > 5 or y-y0 < -5)
{ ; mouse has moved
clip0 := ClipBoardAll ; save old clipboard
;ClipBoard =
Send ^c ; selection -> clipboard
ClipWait 1, 1 ; restore clipboard if no data
IfEqual ClipBoard,, SetEnv ClipBoard, %clip0%
}
return
}
}
; Otherwise, button was released quickly enough. Wait to see if it's a double-click:
TimeButtonUp = %A_TickCount%
Loop
{
Sleep 10
GetKeyState, LButtonState, LButton, P
if LButtonState = D ; Button has been pressed down again.
break
elapsed = %A_TickCount%
elapsed -= %TimeButtonUp%
if elapsed > 350 ; No click has occurred within the allowed time, so assume it's not a double-click.
return
}
;Button pressed down again, it's at least a double-click
TimeButtonUp2 = %A_TickCount%
Loop
{
Sleep 10
GetKeyState, LButtonState2, LButton, P
if LButtonState2 = U ; Button has been released a 2nd time, let's see if it's a tripple-click.
break
}
;Button released a 2nd time
TimeButtonUp3 = %A_TickCount%
Loop
{
Sleep 10
GetKeyState, LButtonState3, LButton, P
if LButtonState3 = D ; Button has been pressed down a 3rd time.
break
elapsed = %A_TickCount%
elapsed -= %TimeButtonUp%
if elapsed > 350 ; No click has occurred within the allowed time, so assume it's not a tripple-click.
{ ;Double-click
Send, ^c
return
}
}
;Tripple-click:
Sleep, 100
Send, ^c
return
~^a::Send, ^c ;Ctl+A = Select All, then Copy
You can modify the script as per your need. However, if you don’t know much about it, then keep this default script. You can read more about this code as well as follow the discussion here.
Step 5: Now double-click that AHK script and it will start running in the system tray. That’s it! Now it will serve you to automatically copy selected text to clipboard. Select some text content and paste somewhere. No need to use Ctrl+C or right-click context menu to copy the text.
Method 2: Automatically Copy Selected Text To Clipboard In Windows 10 Using Free DragKing Software
Above method is a bit lengthy but effective. If you already have AutoHotkey, then you can just add the above script and use with your existing software. However, if you need a simpler solution, then DragKing is a good option to try. It is a simple software that silently runs in the System Tray and copies any selected text to clipboard. The best part is that you can also use middle mouse button or some other hotkey combination to paste the copied content. This software works for almost all applications, web browsers, etc., except Sticky Notes.
Step 1: Get the portable application of this software and execute it. That’s it! The software is ready now. Whatever text content you will select, it is copied to the clipboard. One interesting feature is that after copying the selected text, it also shows the total number of words, lines, and characters available in the selected text content.
Step 2: This step is helpful to enable/disable this software. You can enable/disable it just by double-clicking its system tray icon. Thus, when you don’t want to use this software, you can temporarily stop it.
Step 3: Use this step to access Settings of this software and configure the options. You can set hotkeys to disable the software, paste the copied text, and add characters that you want to ignore or use delimeters.
Set options and save settings.
The Verdict:
Both the methods are good. However, method 1 is more useful because it lets you copy selected text from Sticky Notes also. Still, if you find scripting method complicated, then method 2 is perfect. It will save a lot of time when you need to do copy paste frequently.