One thing in common across all systems is that keyboard shortcuts such as CtrlC are not system-level – they are handled by each program individually, just like the "Copy" or "Paste" menu items are specific to each program. So it's not the OS itself that "copies" something, but rather it's the app (Word) that uses some OS-specific function to put data in the global clipboard.

Windows

In Windows the clipboard API and storage buffer are provided by the OS at kernel level. (The clipboard belongs to the "window station" kernel object.)

  • When you "copy" something, the program will store the "copied" data using the Win32 API function SetClipboardData(), which also corresponds to NtUserSetClipboardData() in the Native API.

    Normally the copied data is immediately stored in the OS-managed clipboard buffer and no longer depends on the source program. The program can provide several different formats – e.g. text copied from Word can simultaneously come in HTML, RTF, and plain-text formats in addition to Word's own format.

    However, the program may store 'null' data and defer conversion until a paste is requested using WM_RENDERFORMAT, e.g. if the copied data is large. In this case the data is lost when the program is closed. You might've seen Word or Photoshop ask about this when exiting the program.

    (Note that when you "cut" or "copy" a whole file through Explorer, this doesn't put the entire file's contents in the clipboard, but only a file reference that Explorer itself will understand when it's pasted.)

  • When you ask the program to "paste", the program chooses the desired format and retrieves it using GetClipboardData(). Some programs, e.g. WordPad or Paint, have a "Paste as" feature that lets you choose the preferred format (e.g. if you copied from a web browser but want to paste without formatting).

See also the blog post "NT Debugging: How the clipboard works".

Linux, BSD, Solaris, OpenVMS

In Linux and other similar systems, the clipboard is provided by the graphical environment you're using (that is, an X11 server or a Wayland compositor) – there is no shared clipboard for programs running outside such an environment.

X11

X11 handles the clipboard a little bit differently – the X server doesn't provide storage at all, it only facilitates communications between the copy-source program (which announces that it has something "copied") and the paste-target program.

Both the initial "copy" announcement and the later "paste" transfer are done via X11 messages according to the ICCCM protocol. (Each X display therefore has a separate clipboard

  • Upon pressing CtrlC, the source program will keep track of "copied" data in its own memory and will claim ownership of the X11 "selection" called 'CLIPBOARD', which is done using XSetSelectionOwner().

    This ownership is tracked centrally by the X server (e.g. Xorg). Whenever you "copy" something new, the previous app that owned the 'CLIPBOARD' selection is informed about losing its ownership so that it can discard the now-unneeded data.

    Because clipboard transfer is always deferred, the copied data is usually lost as soon as you close the "source" program (unless you're running a "clipboard manager" which proactively stores everything that is copied). So if you copy something from Firefox and then close Firefox, you cannot paste it anymore.

  • When pasting, the program will look up the current owner of the 'CLIPBOARD' selection using XGetSelectionOwner(). Similar to Windows, it is possible for X11 clipboard to hold data in several alternative types so the destination program will ask the source for the preferred type using XConvertSelection().

    (Usually a special type named 'TARGETS' is available, which has the source program return an ASCII list of data types that are currently available.)

See this link for a practical example.

Note: When you "copy" text by selecting it and paste it using middle-click, the mechanism is the same but the 'PRIMARY' selection is used instead. This is where the term 'X11 selection' comes from.

Wayland

I don't actually understand how it works in Wayland, all I have is the protocol docs:

  • https://wayland.freedesktop.org/docs/html/ch04.html#sect-Protocol-data-sharing

  • https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_data_device

  • See https://github.com/bugaevc/wl-clipboard for a command-line tool.

Non-graphical programs

Traditional text editors (Vim, emacs, nano) often have their own internal clipboards (aka registers/killrings).

Terminal-based apps may access X11 or Wayland clipboards if running inside a graphical terminal emulator, e.g. Vim's "+ register will paste from the X11 clipboard (whereas other Vim registers are internal to the program).

macOS (Mac OS X)

In macOS, something called a "pasteboard server" appears to be used (which I think means that programs communicate with it through Mach APIs). Other than that, it behaves like the Windows clipboard and stores the currently copied data itself.

  • https://developer.apple.com/documentation/appkit/nspasteboard

  • There is a sample application: https://developer.apple.com/library/archive/samplecode/ClipboardViewer/Introduction/Intro.html

I'm more intrigued with images, how can they be copied so easily

There is nothing special about images – they're still just chunks of binary data that can be represented as bytes, so if they can be saved in a file (e.g. in PNG or JPEG format), they can also be stored in the clipboard using the same format.

Windows apps typically store copied images in BMP/DIB formats (the same as in a .bmp file), while on Linux it is common for apps to offer PNG (i.e. "image/png" target).

🌐
Microsoft Community Hub
techcommunity.microsoft.com › microsoft community hub › communities › products › windows › windows 10
Ctrl + C and Ctrl + V stopped working | Microsoft Community Hub
February 8, 2024 - After working perfectly for years usin my Lenovo laptop, now when I try to copy or paste using the keyboard shortcuts they do not work. For...
Discussions

"The Origins of Ctrl+C, Ctrl+V, Ctrl+X, and Ctrl+Z Explained" - Off-Topic - Haiku Community
I would suggest that anyone and everyone that thinks that Apple ripped off Xerox should be told that Apple gave stock to Xerox in exchange for being allowed to use “a version” of the Xerox Alto interface · Xerox later sold that stock for millions of dollars. More on discuss.haiku-os.org
🌐 discuss.haiku-os.org
6
January 20, 2023
history - Why is Ctrl-V the Paste shortcut? - Retrocomputing Stack Exchange
Stack Exchange network consists ... their knowledge, and build their careers. Visit Stack Exchange ... Bring the best of human thought and AI automation together at your work. Explore Stack Internal ... We now casually use the Ctrl-C to Copy.... More on retrocomputing.stackexchange.com
🌐 retrocomputing.stackexchange.com
ctrl C and ctrl V - Apple Community
I have lived too long in the Windows world. But, without even thinking about it, I use ctrl C for copying and ctrl V for pasting. The keys are just the right distance apart to make this easy. On my Intel MacBook, I have to use the Apple key and either C or V to copy and paste. More on discussions.apple.com
🌐 discussions.apple.com
October 7, 2008
One key insted of Ctrl+C or Ctrl+V
Hi, Does any one know a method to do copy or paste some text by using only one key stroke rather than using a key combination? Is there any tool that will... More on community.x10hosting.com
🌐 community.x10hosting.com
9
February 7, 2010
People also ask

What is a Ctrl+V?
Ctrl+V is a keyboard shortcut used to paste information into a computer document. It works by copying the data that has been highlighted and then pasting it into the document. This shortcut is used in many applications, such as word processors and text editors. The shortcut is also used to easily copy text from one source and paste it into another, making transferring data between programs faster and more efficient.
🌐
lenovo.com
lenovo.com › home
CTRL V: What is a Ctrl+V | How do I use Ctrl+V | Lenovo US
How do I use Ctrl+V?
Using Ctrl + V to copy content from one place and paste it into another could not be simpler. First, highlight the content you wish to copy - this can be done by dragging the mouse across the desired area or holding down the Shift + arrow keys on your keyboard to select multiple lines of text if needed. Once selected, press the combination Ctrl + V' on your keyboard simultaneously - this will paste all of the content at once into whatever program you are currently using.
🌐
lenovo.com
lenovo.com › home
CTRL V: What is a Ctrl+V | How do I use Ctrl+V | Lenovo US
What does Ctrl+V do?
Ctrl+V is used to quickly copy or move data from one place to another. When you press Ctrl + V on your keyboard, the highlighted content will be copied and placed where your cursor is located, enabling quick transfer of text or other items. It eliminates the need for manual entry, making it easier and quicker for users to move information around their computers.
🌐
lenovo.com
lenovo.com › home
CTRL V: What is a Ctrl+V | How do I use Ctrl+V | Lenovo US
Top answer
1 of 1
169

One thing in common across all systems is that keyboard shortcuts such as CtrlC are not system-level – they are handled by each program individually, just like the "Copy" or "Paste" menu items are specific to each program. So it's not the OS itself that "copies" something, but rather it's the app (Word) that uses some OS-specific function to put data in the global clipboard.

Windows

In Windows the clipboard API and storage buffer are provided by the OS at kernel level. (The clipboard belongs to the "window station" kernel object.)

  • When you "copy" something, the program will store the "copied" data using the Win32 API function SetClipboardData(), which also corresponds to NtUserSetClipboardData() in the Native API.

    Normally the copied data is immediately stored in the OS-managed clipboard buffer and no longer depends on the source program. The program can provide several different formats – e.g. text copied from Word can simultaneously come in HTML, RTF, and plain-text formats in addition to Word's own format.

    However, the program may store 'null' data and defer conversion until a paste is requested using WM_RENDERFORMAT, e.g. if the copied data is large. In this case the data is lost when the program is closed. You might've seen Word or Photoshop ask about this when exiting the program.

    (Note that when you "cut" or "copy" a whole file through Explorer, this doesn't put the entire file's contents in the clipboard, but only a file reference that Explorer itself will understand when it's pasted.)

  • When you ask the program to "paste", the program chooses the desired format and retrieves it using GetClipboardData(). Some programs, e.g. WordPad or Paint, have a "Paste as" feature that lets you choose the preferred format (e.g. if you copied from a web browser but want to paste without formatting).

See also the blog post "NT Debugging: How the clipboard works".

Linux, BSD, Solaris, OpenVMS

In Linux and other similar systems, the clipboard is provided by the graphical environment you're using (that is, an X11 server or a Wayland compositor) – there is no shared clipboard for programs running outside such an environment.

X11

X11 handles the clipboard a little bit differently – the X server doesn't provide storage at all, it only facilitates communications between the copy-source program (which announces that it has something "copied") and the paste-target program.

Both the initial "copy" announcement and the later "paste" transfer are done via X11 messages according to the ICCCM protocol. (Each X display therefore has a separate clipboard

  • Upon pressing CtrlC, the source program will keep track of "copied" data in its own memory and will claim ownership of the X11 "selection" called 'CLIPBOARD', which is done using XSetSelectionOwner().

    This ownership is tracked centrally by the X server (e.g. Xorg). Whenever you "copy" something new, the previous app that owned the 'CLIPBOARD' selection is informed about losing its ownership so that it can discard the now-unneeded data.

    Because clipboard transfer is always deferred, the copied data is usually lost as soon as you close the "source" program (unless you're running a "clipboard manager" which proactively stores everything that is copied). So if you copy something from Firefox and then close Firefox, you cannot paste it anymore.

  • When pasting, the program will look up the current owner of the 'CLIPBOARD' selection using XGetSelectionOwner(). Similar to Windows, it is possible for X11 clipboard to hold data in several alternative types so the destination program will ask the source for the preferred type using XConvertSelection().

    (Usually a special type named 'TARGETS' is available, which has the source program return an ASCII list of data types that are currently available.)

See this link for a practical example.

Note: When you "copy" text by selecting it and paste it using middle-click, the mechanism is the same but the 'PRIMARY' selection is used instead. This is where the term 'X11 selection' comes from.

Wayland

I don't actually understand how it works in Wayland, all I have is the protocol docs:

  • https://wayland.freedesktop.org/docs/html/ch04.html#sect-Protocol-data-sharing

  • https://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_data_device

  • See https://github.com/bugaevc/wl-clipboard for a command-line tool.

Non-graphical programs

Traditional text editors (Vim, emacs, nano) often have their own internal clipboards (aka registers/killrings).

Terminal-based apps may access X11 or Wayland clipboards if running inside a graphical terminal emulator, e.g. Vim's "+ register will paste from the X11 clipboard (whereas other Vim registers are internal to the program).

macOS (Mac OS X)

In macOS, something called a "pasteboard server" appears to be used (which I think means that programs communicate with it through Mach APIs). Other than that, it behaves like the Windows clipboard and stores the currently copied data itself.

  • https://developer.apple.com/documentation/appkit/nspasteboard

  • There is a sample application: https://developer.apple.com/library/archive/samplecode/ClipboardViewer/Introduction/Intro.html

I'm more intrigued with images, how can they be copied so easily

There is nothing special about images – they're still just chunks of binary data that can be represented as bytes, so if they can be saved in a file (e.g. in PNG or JPEG format), they can also be stored in the clipboard using the same format.

Windows apps typically store copied images in BMP/DIB formats (the same as in a .bmp file), while on Linux it is common for apps to offer PNG (i.e. "image/png" target).

🌐
YouTube
youtube.com › shorts › tC7YCuRzzPQ
How to use Ctrl C and Ctrl V | How to Copy and paste text,images,folders - YouTube
Welcome to our YouTube tutorial on "How to Use Ctrl C and Ctrl V: Mastering the Art of Copying and Pasting Text, Images, and Folders." In this comprehensive ...
Published   June 26, 2023
🌐
Haiku
discuss.haiku-os.org › off-topic
"The Origins of Ctrl+C, Ctrl+V, Ctrl+X, and Ctrl+Z Explained" - Off-Topic - Haiku Community
January 20, 2023 - I would suggest that anyone and everyone that thinks that Apple ripped off Xerox should be told that Apple gave stock to Xerox in exchange for being allowed to use “a version” of the Xerox Alto interface · Xerox later sold that stock for millions of dollars.
🌐
Yahoo! Finance
finance.yahoo.com › quote › CTRL.V
Edge Total Intelligence Inc. (CTRL.V) Stock Price, News, Quote & History - Yahoo Finance
4 days ago - Loading chart for CTRL.V · Previous Close · 0.8100 · Open · 0.8100 · Bid 0.8100 x -- Ask 0.8400 x -- Day's Range · 0.8000 - 0.8100 · 52 Week Range · 0.2000 - 1.0500 · Volume · 4,415 · Avg. Volume · 66,981 · Market Cap (intraday) 44.234M · Beta (5Y Monthly) 0.87 ·
Find elsewhere
🌐
Lenovo
lenovo.com › home
CTRL V: What is a Ctrl+V | How do I use Ctrl+V | Lenovo US
Please visit cart for more details. ... Please review your cart as items have changed. ... Ctrl+V is a keyboard shortcut used to paste information into a computer document. It works by copying the data that has been highlighted and then pasting it into the document.
🌐
Linux Mint Forums
forums.linuxmint.com › board index › main edition support › software & applications
Ctrl+C to copy and Ctrl+V to paste in terminal - Linux Mint Forums
May 1, 2024 - In Linux Mint terminal (don't know for other distros) we use shortcuts Ctrl+Shift+C to copy and Ctrl+Shift+V to paste. I find it excessive,difficult almost impossible with arthritis. Why not just Ctrl+C and Ctrl+V? Just to make it different from Windows? The purpose is cheap and the price is ...
🌐
Apple Community
discussions.apple.com › thread › 1591594
ctrl C and ctrl V - Apple Community
October 7, 2008 - I have lived too long in the Windows world. But, without even thinking about it, I use ctrl C for copying and ctrl V for pasting. The keys are just the right distance apart to make this easy. On my Intel MacBook, I have to use the Apple key and either C or V to copy and paste.
🌐
Graham Chastney
grahamchastney.com › 2008 › 11 › 07 › my-tools-keyboard-shortcuts-ctrlx-ctrlc-and-ctrlv
My Tools: Keyboard Shortcuts Ctrl+X, Ctrl+C and Ctrl+V – Graham Chastney
November 7, 2008 - I feel a little embarrassed writing ... what people don’t know. So for those of you who didn’t know: Ctrl+X is Cut Ctrl+C is Copy Ctrl+V is Paste The first ......
🌐
x10Hosting
community.x10hosting.com › forums › site design, development, and promotion › scripts, 3rd party apps, and programming
One key insted of Ctrl+C or Ctrl+V | x10Hosting: Free Hosting Community
February 7, 2010 - I could make you a VB.Net application that would attach itself as a service and interpret a specific key as this command. ... Personally I don't see the advantage of copying and pasting in one keystroke. Most of the time, when you copy, you paste in some other application. ... As it is already a shortcut, you'd have to remove the functionality of one of your keys to get a 'one keystrocke CTRL+C' Control C/V aren't hard to type quickly plus if you made a designated copy/paste key, you'd probably hit it accidentally a lot.
🌐
Nevada Department of Agriculture
ada.nv.gov › uploadedFiles › adanewnvgov › content › Training › KeyboardShortcuts.pdf pdf
Keyboard Shortcuts
Insert a character with an accent (grave) mark, where <char> is the character you want. For example, if you wanted an accented è you would use Ctrl+'+eas your shortcut key. To · reverse the accent mark use the opposite accent mark, often on the tilde key. ... View or hide non printing characters.
🌐
Visual Studio Code
code.visualstudio.com › shortcuts › keyboard-shortcuts-windows.pdf pdf
General Ctrl+Shift+P, F1 Show Command Palette Ctrl+P Quick Open, Go to File…
Show Source Control · Ctrl+Shift+D · Show Debug · Ctrl+Shift+X · Show Extensions · Ctrl+Shift+H · Replace in files · Ctrl+Shift+J · Toggle Search details · Ctrl+Shift+U · Show Output panel · Ctrl+Shift+V · Open Markdown preview · Ctrl+K V · Open Markdown preview to the side ·
🌐
Quora
quora.com › Is-there-one-key-instead-of-Ctrl-C-or-Ctrl-V
Is there one key instead of Ctrl+C or Ctrl+V? - Quora
Answer (1 of 2): Use an add-in utility or one included with your operating system to redefine a keystroke as “Copy” and another as “Paste.” In many operating systems, you can also use Ctrl+ for Copy and Shift+ for Paste. I preferred that, but some notebook keyboards no longer hav...
🌐
Microsoft Support
support.microsoft.com › en-us › windows › keyboard-shortcuts-in-windows-dcc61a57-8ff0-cffe-9796-cb9706c75eec
Keyboard shortcuts in Windows - Microsoft Support
If you're trying to take a screenshot or screengrab, see Use Snipping Tool to capture screenshots. ... The behavior of some keyboard shortcuts may vary in different applications. For example, Ctrl + Shift + V to paste as plain text may not work in all applications.
🌐
W3Schools
w3schools.com › tags › ref_keyboardshortcuts.asp
Keyboard Shortcuts
HTML by Alphabet HTML by Category HTML Browser Support HTML Attributes HTML Global Attributes HTML Events HTML Colors HTML Canvas HTML Audio/Video HTML Character Sets HTML Doctypes HTML URL Encode HTML Language Codes HTML Country Codes HTTP Messages HTTP Methods PX to EM Converter Keyboard Shortcuts