Questions tagged [clipboard]

The clipboard is a software facility that can be used for short-term data storage and/or data transfer between documents or applications, via copy and paste operations.

It is most commonly a part of a GUI environment and is usually implemented as an anonymous, temporary block of memory that can be accessed from most or all programs within the environment via defined programming interfaces. A typical application accesses clipboard functionality by mapping user input (keybindings, menu selections, etc.) to these interfaces.

The semantics of the clipboard facility varies from one operating environment to another, and can also vary between versions of the same system. They can sometimes be changed programmatically or by user preference. This can lead to user frustration when switching between environments with different clipboard semantics particularly as copy and paste operations often become embedded in the user's muscle memory.

Most environments support a single clipboard transaction. Each cut or copy overwrites the previous contents. Normally, paste operations copy the contents, leaving the contents available in the clipboard for further pasting operations.

http://en.wikipedia.org/wiki/Clipboard_(software)

3533 questions
3730
votes
62 answers

How do I copy to the clipboard in JavaScript?

What is the best way to copy text to the clipboard (multi-browser)? I have tried: function copyToClipboard(text) { if (window.clipboardData) { // Internet Explorer window.clipboardData.setData("Text", text); } else { …
Santiago Corredoira
  • 40,844
  • 8
  • 48
  • 56
1081
votes
31 answers

Pipe to/from the clipboard in Bash script

Is it possible to pipe to/from the clipboard in Bash? Whether it is piping to/from a device handle or using an auxiliary application, I can't find anything. For example, if /dev/clip was a device linking to the clipboard we could do: cat /dev/clip …
moinudin
  • 117,949
  • 42
  • 185
  • 213
944
votes
5 answers

How does Trello access the user's clipboard?

When you hover over a card in Trello and press Ctrl+C, the URL of this card is copied to the clipboard. How do they do this? As far as I can tell, there is no Flash movie involved. I've got Flashblock installed, and the Firefox network tab shows no…
Boldewyn
  • 75,918
  • 43
  • 139
  • 205
866
votes
32 answers

How to make vim paste from (and copy to) system's clipboard?

Unlike other editors, vim stores copied text in its own clipboard. So, it's very hard for me to copy some text from a webpage and paste it into the current working file. It so happens I have to either open gedit or type it manually. Can I make vim…
Santosh Kumar
  • 22,275
  • 18
  • 59
  • 100
842
votes
36 answers

How to copy to clipboard in Vim?

Is it possible to copy to clipboard directly from Vim? yy only copies stuff to Vim's internal buffer. I want to copy to the OS's clipboard. Is there any such command in Vim or you can only yank stuff within Vim?
Hari Menon
  • 29,411
  • 12
  • 76
  • 104
636
votes
21 answers

How can I copy the output of a command directly into my clipboard?

How can I pipe the output of a command into my clipboard and paste it back when using a terminal? For instance: cat file | clipboard
Legend
  • 104,480
  • 109
  • 255
  • 385
485
votes
6 answers

How to copy data to clipboard in C#

How can I copy a string (e.g "hello") to the System Clipboard in C#, so next time I press CTRL+V I'll get "hello"?
aharon
  • 6,597
  • 9
  • 34
  • 48
380
votes
23 answers

How to Copy Text to Clip Board in Android?

Can anybody please tell me how to copy the text present in a particular textview to clipboard when a button is pressed? @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); …
327
votes
20 answers

JavaScript get clipboard data on paste event (Cross browser)

How can a web application detect a paste event and retrieve the data to be pasted? I would like to remove HTML content before the text is pasted into a rich text editor. Cleaning the text after being pasted afterwards works, but the problem is that…
Alex
  • 11,437
  • 7
  • 39
  • 51
283
votes
8 answers

How do I copy the contents of a String to the clipboard in C#?

If I have some text in a String, how can I copy that to the clipboard so that the user can paste it into another window (for example, from my application to Notepad)?
Elie
  • 13,253
  • 22
  • 70
  • 127
227
votes
27 answers

How to copy a selection to the OS X clipboard

I have an area selected in Vim. How can I copy it into the OS X clipboard? (The OS X clipboard can be written to via a pipe to /usr/bin/pbcopy)
ʞɔıu
  • 43,326
  • 30
  • 94
  • 142
225
votes
21 answers

In reactJS, how to copy text to clipboard?

I'm using ReactJS and when a user clicks a link I want to copy some text to the clipboard. I am using Chrome 52 and I do not need to support any other browsers. I can't see why this code does not result in the data being copied to the clipboard.…
Duke Dougal
  • 18,469
  • 24
  • 73
  • 103
213
votes
24 answers

How do I copy a string to the clipboard?

I'm trying to make a basic Windows application that builds a string out of user input and then adds it to the clipboard. How do I copy a string to the clipboard using Python?
tester
  • 20,193
  • 21
  • 80
  • 120
206
votes
2 answers

Copy text to clipboard with iOS

What is the best way to copy text to the iPhone's clipboard in your application? Their docs are sketchy and have way more features than what I want... I just want to set a string as the users clipboard.
tarnfeld
  • 23,722
  • 39
  • 106
  • 145
197
votes
8 answers

Yank file name / path of current buffer in Vim

Assuming the current buffer is a file open for edit, so :e does not display E32: No file name. I would like to yank one or all of: The file name exactly as show on the status line, e.g. ~\myfile.txt A full path to the file, e.g.…
davetapley
  • 14,759
  • 11
  • 54
  • 74
1
2 3
99 100