Questions tagged [clipboard-interaction]
43 questions
453
votes
32 answers
How to Copy Text to Clipboard 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);
…

Darshan Gowda
- 4,956
- 3
- 19
- 27
44
votes
11 answers
Wysiwyg with image copy/paste
First, I understand that an image cannot be "copied" from a local machine into a website. I understand that it must be uploaded. I am a web programmer, and am familiar with common web wysiwyg tools such as TinyMCE and FCKEditor. My question is if…

jW.
- 9,280
- 12
- 46
- 50
23
votes
1 answer
How to copy data to the clipboard with Greasemonkey?
I found this question but trying to use the code given there:
unsafeWindow.netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
const clipboardHelper = Components.classes["@mozilla.org/widget/clipboardhelper;1"]
…

LA_
- 19,823
- 58
- 172
- 308
12
votes
1 answer
How do you copy and paste from a THtmlViewer object?
At the moment I have the following hack:
procedure TForm1.HTMLViewer1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if (Key = Word('C')) and (Shift = [ssCtrl]) then
HTMLViewer1.CopyToClipboard;
end;
Is there a…

Nicholas Grasevski
- 489
- 5
- 10
11
votes
3 answers
Listener for clipboard content change?
Is there a way to register a method so that it's automatically called as soon as the user ends "text selection mode" (thereby copying selection to clipboard)?

Regex Rookie
- 10,432
- 15
- 54
- 88
4
votes
2 answers
In what circumstances will GetClipboardData(CF_TEXT) return NULL?
I have this intermittent and incosistent problem which has been driving me crazy for a long time: In a program of mine, GetClipboardData(CF_TEXT) succeeds 90% (or so) of the time, but every once in a while it returns NULL.
This is despite the fact…

Android Eve
- 14,864
- 26
- 71
- 96
3
votes
3 answers
Firefox Extension that copies HTML link to current web page to clipboard and not just the URL
The Situation
I need to automate the copying of a HTML link to the current page that
is viewed in the current Firefox Tab into other WYSIWYG editors. This
is not the same as copying just the plain-text of the URL, nor is it
the same as pasting just…

bgoodr
- 2,744
- 1
- 30
- 51
3
votes
1 answer
Java - Listen for copy and paste from clipboard
( 1 ) Is there a way to listen for any clipboard updates (including Ctrl+C/X, PrtSc (screenshot) and changes made by other programs) in Java? I have tried this:
Toolkit.getDefaultToolkit().getSystemClipboard().addFlavorListener(new…

German Vekhorev
- 339
- 6
- 16
3
votes
1 answer
Copy selected text via a context menu option in a Chrome extension
I am trying to create a context menu option which copies some text to the system clipboard.
Currently, I am just copying a hard-coded string literal, but I am wondering how it could be changed to copy selected text. Specifically, I don't know how…

Luke
- 5,567
- 4
- 37
- 66
3
votes
2 answers
How to handle URL relative/absolute "glitch" in contenteditable when copy and pasting
In contenteditable regions, if you paste an element with a URL attribute, in some browsers it converts the URL from relative to absolute.
I've read through some bug reports that claim it's "fixed" in the latest release, but it's not.
I threw…

Casey Dwayne
- 2,142
- 1
- 17
- 32
2
votes
1 answer
How to free clipboard locked by another process?
I have an issue where in i am trying to retrieve object from clipboard modify it and add it back ...
Time and again I keep getting
requested operation on clipboard could not be performed
Looks like the clipboard is being locked by some process,…

Nick
- 586
- 2
- 7
- 22
2
votes
0 answers
Browser `paste` event with multiple files selection
I'm having trouble with handling paste to browser, with multiple images clipboard. I'm using the following snippet:
document.addEventListener('paste', event => {
console.log(event.items)
})
It works if a single file was selected, showing 3 items,…

tungd
- 14,467
- 5
- 41
- 45
2
votes
2 answers
Copying formatted text into clipboard
I have strange problem with coping text into clipboard. I want to copy text from textbox with additional formatting. In order to do that I intercept KeyDown event on textbox and I check if keys CTRL and C are pressed. Then I do sth like that
…

sensorlearner
- 51
- 1
- 2
2
votes
2 answers
Python3: storing a link recognized as HTML format in clipboard
How can to store this link my link in the clipboard to be able to past it in HTML mode (and not source code) in an HTML editor?
Pasting it in an editor should only show the text my link with a clickable link.
Using…

JinSnow
- 1,553
- 4
- 27
- 49
2
votes
1 answer
Copy multiple (e.g. image and text) things to the Clipboard for pasting into MS office C# Winform
I want to copy multiple things to the clipboard:
Clipboard.SetImage(Image);
Clipboard.SetText(ImageCaption);
However I notice all the Clipboard.Set* functions clear the clipboard first. So in the above example you only get the text. Is there any…

chrispepper1989
- 2,100
- 2
- 23
- 48