You need to use Hooking that contains 3 main part:
A system hook allows you to insert a callback function which
intercepts certain Windows messages (e.g., mouse related messages).
A local system hook is a system hook that is called only when the
specified messages are processed by a single thread.
A global system hook is a system hook that is called when the specified messages are
processed by any application on the entire system.
In Addition to your requirement, you need to use Global system hook. You can use this helpful link.
UPDATE:
I think It's the simple side of story to detect keyboard pressed key, or put an formless app in system tray (Trough This LINK), Also you can easily set a text to clipboard using System.Windows.Forms.Clipboard.SetText("Hello, clipboard");
But , What Text? That's the point of interest. If you wanna get the selected text from any open app that contains select-able text, You need to go in a different way. I've searched a little about it and got this respectable LINK.
UPDATE AGAIN:
As you mentioned in comments, the link's guide doesn't work proper for your demand. I tested it just a few minutes ago and wrote a sample app using that. I've got the selected control text from active windows as result, that means it will nit help as well.
A little searched again and the result is as below:
It is not possible in general to be able to get the value of "any" selected text, because of the fact that programs can re-implement their own version of the Win32 controls any way they see fit, and your program cannot possibly expect to work with all of them.
You can use Microsoft UI Automation that is the new accessibility framework for Microsoft Windows, available on all operating systems. UI Automation provides programmatic access to most user interface (UI) elements on the desktop, enabling assistive technology products such as screen readers to provide information about the UI to end users and to manipulate the UI by means other than standard input. UI Automation also allows automated test scripts to interact with the UI.
Note: As i saw in the samples and questions around it, this solution is not very cool and in addition to others experiment, it won't work for all of apps(Such as Firefox, etc).
Any Helpful quote will add to the answer. It was All I've got for you.
Be Lucky