copy-paste

iOS - detect when user copy to clipboard - [UIPasteboard generalPasteboard]

岁酱吖の 提交于 2019-12-04 11:59:41
问题 quick easy question while using a WebView with some text in it - the user can select a snippet of text from it and press a UIButton which I created - running the following action: -(IBAction)copyToClip { NSString *copyClip = [UIPasteboard generalPasteboard].string; NSLog(@"Clip = %@",copyClip); // (works fine) } I would like to call the same function without a UIButton, thus when the user did a "copy" action it will activate the above code. (I assume a listener) what would be the appropriate

Good IM/Chat solution for pasting code

≡放荡痞女 提交于 2019-12-04 11:52:47
问题 We've got several distributed developers working together on a couple of projects. We've been using Skype to host chats with all the developers, and it works okay except for one thing: It REALLY mangles any code we copy and paste into the chats -- especially the whitespace in Python. This question has tons of opinions about chat clients & servers, but no one has much to say about pasting in code. (https://stackoverflow.com/questions/36415/best-chat-im-tool-for-developers) Is anybody out there

Copy to clipboard as plain text

妖精的绣舞 提交于 2019-12-04 09:15:17
问题 I'm using this code in background.js in a Chrome extension to copy text to the user's clipboard: chrome.runtime.onMessage.addListener( function(request, sender, sendResponse) { if (request.command == "copy") { executeCopy(request.text); sendResponse({farewell: "copy request received"}); } } ); function executeCopy(text){ var copyDiv = document.createElement('div'); copyDiv.contentEditable = true; document.body.appendChild(copyDiv); copyDiv.innerHTML = text; copyDiv.unselectable = "off";

Allow user to copy image from picturebox and save it everywhere

余生颓废 提交于 2019-12-04 08:19:40
In my application I have a pictureBox that shows an image. When user right clicks on the pictureBox and selects Copy from the context menu, I want to copy the image into the clipboard so the user can paste it in folders and anywhere else. How can I do that? EDIT: I use this code but by this user only can paste image into word. var img = Image.FromFile(pnlContent_Picture_PictureBox.ImageLocation); Clipboard.SetImage(img); Arash Milani Clipboard.SetImage copies the image content (binary data) to the clipboard not the file path. To paste a file in Windows Explorer you need to have file paths

Shortcut for copying Ctrl-C not working in Android Studio

左心房为你撑大大i 提交于 2019-12-04 07:56:39
I am able to copy text from other programs and paste it to Android Studio. I am able to right click and copy selected text. I am able to cut text and paste it using shortcut. But while using shortcut Ctrl + C to copy text I am often unable to copy. This is very annoying problem. Does anyone here knows how to solve it? If restarting AS does not resolve the issue you could try Invalidate Caches/Restart option. That sometimes fixes such issues. ----update---- This might fix your issue. I used Invalidate Caches/Restart option and worked for me. you could try that. Easiest Solution - Reset copy

How to delete (not cut) in Vim?

守給你的承諾、 提交于 2019-12-04 07:22:55
问题 How can I delete a line without putting it into my default buffer? Example: line that will be copied. line that I want to be substitued with the previous one. What I'm trying to do: yy dd p But Vim replaces the recent copied string with the deleted (cutted) one. I know that I can use buffers like, "1yy , dd then "1p , but I always forget to put the copied string in a buffer then I need to paste my contents first (line that will be copied) and then delete what I want (line that I want to be

How do you copy and paste into Git Bash

只谈情不闲聊 提交于 2019-12-04 07:17:58
问题 I'm using msysgit running on Windows XP. Tried Ctrl + V , Right click, Middle click, google... no luck. 回答1: Press Insert . Also, to copy from the window, try clicking the console's window icon (topleft) and choosing Edit -> Mark, then drag a box on the text, then press Enter. (You can also paste via the window icon menu, but the key is faster.) UPDATE Starting from Windows 10 the CTRL + C , CTRL + V and a lot of other feature are implemented in conhost.exe so they should work with every

WPF - insufficient memory when doing copy/paste vs drag/drop with view model data

送分小仙女□ 提交于 2019-12-04 04:56:07
问题 I have a TreeView that provides drag and drop as well as copy/paste functionality. I extended TreeViewItem to provide that functionality. The drag and drop works fine. The tree is bound to a view model, and the drag is initiated in the TreeViewItem custom class such as: protected override void OnMouseMove(MouseEventArgs e) { // ... if (canDrag) { DragDrop.DoDragDrop(this, DataContext, DragDropEffects.Copy); e.Handled = true; } } The drop is initiated such as: protected override void OnDrop

Paste image to a web page

泄露秘密 提交于 2019-12-04 04:30:40
I did some research for a wysiwyg editor and found ckeditor that seems to be nice however I need to be able to copy/paste an image to the editor. I found this web site that do exactly what I need http://pasteboard.co/ so its possible however I cannot find how it's done. Do you have any ideas or solutions? I would prefer a solution in pure html5/javascript and avoid any plugin but a silverlight or flash is acceptable too. There are two ways you can handle this, the easy way, and the hard way. The Easy Way: Utilize the Clipboard API . This is an "HTML5" API, but it is only properly supported in

Firefox - document.execCommand(‘cut’/‘copy’) was denied because it was not called from inside a short running user-generated event handler

筅森魡賤 提交于 2019-12-04 02:58:12
问题 I am developing a single-page app, I have a button on the page, when a user clicks the button I would like to make an ajax call to my server, and then copy the returned value (via callback) to the user's clipboard. Each component works in isolation, but when I glue them together Firefox returns the following error: document.execCommand(‘cut’/‘copy’) was denied because it was not called from inside a short running user-generated event handler I would like to know the specifics of this error,