
The clipboard doesn’t really care or even understand what’s being copied or pasted it just acts as an intermediary between the program from which data is copied and the program into which the data is pasted. In our example, the “list” of preferred formats was only one item long, so the clipboard took the plain text of the copied data provided by Word and gave it to Notepad. When you paste, the clipboard takes the highest-priority-requested format that was made available by the original copy, and provides that to application into which the data is to be pasted. Paste has a similar complication in that the program you’re pasting into asks the clipboard for the data in a priority-ordered list of preferred formats. But that information, along with the data to be copied (in most cases more on that in a moment), is given to the clipboard when you copy something. The result is that when you copy something to the clipboard, the application you’re copying from provides a little more information than just the data to be copied it includes the formats it can make that data available in.ĭepending on the sophistication of the program you’re copying from, it may offer many different formats - as Word might - or it might offer only one. We can’t assume that the destination application knows what to do with the way the information is stored.We can’t assume that the clipboard understands what is being copied.Ideally, it makes the highest fidelity of whatever has been copied available, but someone has to handle the conversion from one format (fancy and formatted) to the other (plain text). Word, for example, doesn’t know where the data will be pasted, or what the capabilities of the receiving program might be. Copy/pasting from Word to Notepad is, in fact, a convenient way to get only the text.īut as you might imagine, under the hood things are more complex. Notepad doesn’t do formatting it’s text-only. If you’ve ever copy/pasted from a word-processing program like Microsoft Word into a plain-text-editing program like Notepad, you may have noticed that all the formatting is lost. 4Ĭonceptually, that’s how the clipboard works, and in some cases, it actually does work that way.īut in many cases, it doesn’t. The text will remain in the clipboard until the next time I copy something to it, because the clipboard can hold only one thing at a time. When done, the text I’ve selected exists in three places: In the example above, I’ve copy/pasted some text 3 from one document to another via the clipboard. Then, you identify a new location into which you want to place the copied item, and paste it there, once again using a keystroke or mouse sequence. First, you identify the item you want to copy - usually via a selection of some sort - and then copy it to the clipboard using a keystroke or mouse sequence. You can then paste 2 it somewhere, which copies what’s in the clipboard to the location you indicate.

I’m grossly oversimplifying in order to make concepts and behavior clearer for non-programmers.Ĭonceptually, the clipboard is extremely simple: you copy 1 something to it, where it remains until overwritten by another copy-to-clipboard. It almost certainly doesn’t work exactly as I outline below.

I have to start with the usual caveat: this is not meant to be a detailed treatise on the inner workings of the clipboard. It’s more complex than you might realize. Let’s review some of the magic behind the clipboard’s curtain.

… except when it doesn’t do what we expect. It’s one of those things we use daily, take for granted, and rarely even think about … The clipboard is a pretty amazing concept.
