clipboard

Copy and paste the selected text to the clipboard using JavaScript

不羁的心 提交于 2019-11-30 21:58:30
问题 I'm building a custom right-click menu for my system and I need to know how can I make a JavaScript function to copy the selected text, basically 100% like the original right-click menu does. I'm aware of the Flash work-arounds. I want to do this in JavaScript. Every answer I've seen so far is only a half-answer because none of them explains how to make a copy button for the selected text - all what they do is copy a pre-defined text or a text from a textbox. 回答1: Modern Day Browsers block

ClipBoard Monitor C# [duplicate]

删除回忆录丶 提交于 2019-11-30 21:05:15
问题 This question already has answers here : Closed 9 years ago . Possible Duplicate: Clipboard event C# Hi, Can I monitor the clipboard continuously for any copy operations? I'm using C# Thanks 回答1: Here are some more helpful links, with source code: SetClipboardViewer usage: http://www.radsoftware.com.au/articles/clipboardmonitor.aspx Monitoring Activity: http://www.codeguru.com/columns/dotnettips/article.php/c7315 A viewer: http://www.doogal.co.uk/clip.php 回答2: You'll need to use the Win32 API

How to keep colors when copy-pasting from datagridview to excel?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 20:45:55
问题 I use the following CellFormatting code to conditionally color rows in my datagridview. private void SGridView_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { if (e.ColumnIndex == SGridView.Columns["Name"].Index ) { DataGridViewRow row = SGridView.Rows[e.RowIndex]; SBomRow BomRow = (SBomRow )row.DataBoundItem; switch (BomRow.UsageType()) { case (UsageType.NE): break; case (UsageType.SV): e.CellStyle.BackColor = Color.OrangeRed; break; case (UsageType.Mix): e.CellStyle

Accessing text copied to clipboard by python

我们两清 提交于 2019-11-30 20:01:00
问题 So I want to be able to use a python script to copy the contents of a folder and then be able to paste those contents to a location of my choosing i.e. text file, browser, etc... I came across this solution for copying text to the clipboard, but when i implement this solution I am not able to paste anything. I am using python 3.4. Below is code i am using: import os import tkinter as tk import tkinter.filedialog r = tk.Tk() r.withdraw() photo_path= tkinter.filedialog.askdirectory(title='Which

Java: use clipboard to copy-paste java objects between different instances of same application

老子叫甜甜 提交于 2019-11-30 19:57:49
I am trying to implement copy-paste of objects between different instances of same application. Currently it works only in one application (I mean, copy and paste in the same instance of application), but does not work between different instances. Copying code: // MyObject is a class of objects I want to copy/paste; // MyObjectSelection is a class that impements Transferable and ClipboardOwner interfaces Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); MyObject data = new MyObject(selectedItems); MyObjectSelection dataSelection = new MyObjectSelection(data); clipboard

Getting data off the Clipboard inside a BackgroundWorker

倾然丶 夕夏残阳落幕 提交于 2019-11-30 18:17:27
问题 I have a background worker and in the DoWork method I have the following: var clipboardData = Application.Current.Dispatcher.Invoke(new Action(() => { Clipboard.GetData(DataFormats.Serializable); })); Why does this always return null even though I know there is data on the clipboard in the correct format? 回答1: Try putting the call into an STA thread: object data = null; Thread t = new Thread(() => { data = Clipboard.GetData(DataFormats.Serializable); }); t.SetApartmentState(ApartmentState.STA

What exactly is “label” parameter in ClipData in Android?

百般思念 提交于 2019-11-30 16:46:30
According to the Android documentation , ClipData use "label" as a kind of representation to the copied data. ClippedData is a complex type containing one or Item instances, each of which can hold one or more representations of an item of data. For display to the user, it also has a label and iconic representation. And then it further explains "label" as User-visible label for the clip data in some API docs . However, I'm still confused about the usage of the label. How is this label visible to users? How should I use it? What should I set for this label when I call the ClipData factory method

Copy data from the clipboard on Linux, Mac and Windows with a single Python script

不羁岁月 提交于 2019-11-30 16:00:48
I am trying to create a script in Python that will collect data put in the clipboard by the user and preferably save it as a list or in a text file or string/array/variable to work with later on. This should work on Linux all versions (I would assume Ubuntu), Mac OS all versions and Windows all versions. I am not sure if 32bit and 64bit systems have different ways of accessing the data at the clipboard, if they do I guess it would be safe to make this work for the 32bit versions only so people running the 64bit versions can fall back onto the 32bit version of the OS. The tricky part, apart

Copy data from the clipboard on Linux, Mac and Windows with a single Python script

青春壹個敷衍的年華 提交于 2019-11-30 15:55:02
问题 I am trying to create a script in Python that will collect data put in the clipboard by the user and preferably save it as a list or in a text file or string/array/variable to work with later on. This should work on Linux all versions (I would assume Ubuntu), Mac OS all versions and Windows all versions. I am not sure if 32bit and 64bit systems have different ways of accessing the data at the clipboard, if they do I guess it would be safe to make this work for the 32bit versions only so

Paste command using Selenium

大兔子大兔子 提交于 2019-11-30 15:35:37
I'm using Python 2.7 and Selenium 2-44-0 on Windows 7. I'm looking for a quicker way of inputting text than using send_keys. Send_keys will print 1 letter at a time (which better imitates an actual user). I would like a way to print all of them out at once, as if the content was pasted. For example, Sikuli has the following functionality: paste("this will all populate the field at the same time") I'm wondering if there's a way to write a method in Python that will have the same result. So, instead of: el.send_keys("this will do 1 letter at a time") Have something like el.paste_keys("this will