All projects
Desktop · Self-initiated

Copyless

Selected text reaches the clipboard before you can press Ctrl+C.

Role
Self-initiated
Year
2026
Stack
  • C#
  • .NET Framework
  • Win32 API
  • UI Automation
  • Windows OCR
Status
v1.1.1

On Linux, text you select is ready to paste. Windows has no such thing. Copyless brings it over: release the mouse button and the selection is on the clipboard. That works in any application. For text that cannot be selected, such as in games, images and video, there is the Windows OCR engine.

Windows will not tell you what is selected

There is no API that asks “what is selected right now”. There are two routes, both incomplete, so the program picks one per gesture.

When the cursor is an I-beam it sends a Ctrl+C, then checks GetClipboardSequenceNumber to see whether the clipboard actually changed. That check is the whole trick: without that number you cannot tell a successful copy from a gesture that selected nothing, and in the second case you would treat the previous contents as the new selection.

When that fails, it reads the selection through UI Automation. For mouse gestures that is the element under the cursor, for keyboard selections the focused element.

In a terminal, Ctrl+C is not a copy command

It interrupts the running program. Terminals are recognised by their window class: ConsoleWindowClass, CASCADIA_HOSTING_WINDOW_CLASS, mintty, PuTTY, Alacritty and WezTerm. In those windows only the UI Automation route is used. This is the kind of detail you find by getting it wrong first.

Waiting until the user is done

  • Every modifier has to be released first, or the injected Ctrl+C becomes a Ctrl+Shift+C. With a five second limit, because someone can hold Shift and walk away.
  • Then 25 milliseconds of waiting (45 after a double-click) so the application has finished updating its own selection.
  • If a new gesture starts meanwhile, the old one is dropped: a generation counter discards stale work and the queue collapses to the most recent gesture.

Pasting over your own selection

Before every automatic copy it keeps the previous clipboard contents. Press Ctrl+V right after a selection and that saved fragment lands on top of the fresh one. Replacing without cutting first.

Updating itself

Since 1.1.0 it checks for a new release 45 seconds after starting, and every six hours after that. It reads the GitHub API, downloads the installer and checks its size, its version and the SHA-256 that GitHub publishes alongside the asset. It installs only when all three match. The installer is not code-signed, so that check is what keeps an incomplete or swapped download from being run.

Choices

  • Graphics editors are excluded by default. There, dragging draws, it does not select.
  • The startup task runs with highest privileges, or it can read nothing in windows running as administrator.
  • No network traffic, no telemetry. It builds with the C# compiler already in .NET Framework, so no SDK or Visual Studio is needed.

What it does not do

Every selection overwrites the clipboard; Win+V brings earlier items back. And Chromium browsers switch on their accessibility tree the moment you query them through UI Automation, which costs them some memory. That is the price of the second route, and there is no way around it.