copy-paste

Is there a way to catch ctrl-c and ask the user to confirm?

守給你的承諾、 提交于 2019-12-17 20:15:46
问题 Powershell scripts can easily be terminated by the user pressing ctrl-c. Is there a way for a Powershell script to catch ctrl-c and ask the user to confirm whether he really wanted to terminate the script? 回答1: Checkout this post on the MSDN forums. [console]::TreatControlCAsInput = $true while ($true) { write-host "Processing..." if ([console]::KeyAvailable) { $key = [system.console]::readkey($true) if (($key.modifiers -band [consolemodifiers]"control") -and ($key.key -eq "C")) { Add-Type

How to copy text from Emacs to another application on Linux

跟風遠走 提交于 2019-12-17 17:20:18
问题 When I cut (kill) text in Emacs 22.1.1 (in its own window on X, in KDE, on Kubuntu), I can't paste (yank) it in any other application. 回答1: Let's be careful with our definitions here An Emacs copy is the command kill-ring-save (usually bound to M-w ). A system copy is what you typically get from pressing C-c (or choosing "Edit->Copy" in a application window). An X copy is "physically" highlighting text with the mouse cursor. An Emacs paste is the command yank (usually bound to C-y ). A system

How to disable Paste (Ctrl+V) with jQuery?

浪尽此生 提交于 2019-12-17 07:03:01
问题 How can I disable Paste ( Ctrl + V ) option using jQuery in one of my input text fields? 回答1: This now works for IE FF Chrome properly... I have not tested for other browsers though $(document).ready(function(){ $('#txtInput').on("cut copy paste",function(e) { e.preventDefault(); }); }); Edit: As pointed out by webeno, .bind() is deprecated hence it is recommended to use .on() instead. 回答2: Edit: It's almost 6 years later, looking at this now I wouldn't recommend this solution. The accepted

How to disable Paste (Ctrl+V) with jQuery?

大城市里の小女人 提交于 2019-12-17 07:02:20
问题 How can I disable Paste ( Ctrl + V ) option using jQuery in one of my input text fields? 回答1: This now works for IE FF Chrome properly... I have not tested for other browsers though $(document).ready(function(){ $('#txtInput').on("cut copy paste",function(e) { e.preventDefault(); }); }); Edit: As pointed out by webeno, .bind() is deprecated hence it is recommended to use .on() instead. 回答2: Edit: It's almost 6 years later, looking at this now I wouldn't recommend this solution. The accepted

Excel macro - paste only non empty cells from one sheet to another

断了今生、忘了曾经 提交于 2019-12-17 06:49:10
问题 Below is the code which I am using to copy cells from one sheet and paste in to another. Sheets("codes").Select Range("A5:A100").Select Selection.Copy Sheets("Sheet2").Select Range("B28").Select ActiveSheet.Paste The problem with this is some cells in this range are blank but I do not want them to be copied to Sheet2. I have got some idea from here but this method is too long. Is there a way I can iterate on the selection and check if the value is non-empty and paste. This way I can also

Get text from clipboard using GetText - avoid error on empty clipboard

喜欢而已 提交于 2019-12-17 04:01:41
问题 I'm using code like this to get text from off the Clipboard. Dim DataObj As New MSForms.DataObject DataObj.GetFromClipboard myString = DataObj.GetText I use error handling to get the past the case where the Clipboard is empty, and everything is fine as long as I keep Error Trapping set to Break on Unhandled Errors. However, for unrelated reasons I want to set Error Trapping to Break on All Errors, and this throws an error at DataObj.GetText when it finds the empty Clipboard. Is there any kind

How do I enable standard copy paste for a TextView in Android?

﹥>﹥吖頭↗ 提交于 2019-12-17 03:59:47
问题 I want to enable standard copy paste for a TextView (the same as for EditText). How can I do it? I tried using a non-editable EditText but it didn't work well (sometimes it became editable or the copy paste overlay was not shown). And it's probably not a good approach generally. Need a working solution starting at API 7. 回答1: Try android:textIsSelectable. i.e., android:textIsSelectable="true" 回答2: To enable the standard copy/paste for TextView, U can choose one of the following: Change in

How to disable copy paste option from UITextField programmatically

喜夏-厌秋 提交于 2019-12-17 02:36:29
问题 I am making a registration alertview that has a UITextField in it where the user can enter their registration number. everything is pretty much their, however I would like to remove the copy paste function from the textfield programmatically since their is no InterfaceBuilder version of the textfield I have no idea how to do this.. here Is my UIalertview thus far... - (void)pleaseRegisterDevice { UIAlertView *myAlertView = [[UIAlertView alloc] initWithTitle:@"Please Register Device!" message:

Copying Dynamic Cells/Rows Into New Sheet or Workbook

点点圈 提交于 2019-12-13 20:53:16
问题 I tried searching on the site for a solution to this but I was unable to find an exact match. I'm trying to figure out a VBA code that will do the following: Search through a specified column Locate all matching values (non-specified) Copy the rows of said matching values Place them into a new worksheet or workbook (preferrably workbook) Here is my problem. The value in the specified row can be 1 of over 300 unique values, so specifying each one in the VBA code would be a nightmare. I

Copy worksheet from another workbook including charts

…衆ロ難τιáo~ 提交于 2019-12-13 20:26:00
问题 I want to copy a worksheet from another workbook and replace a sheet in ThisWorkbook. However, I do not want to delete the sheet in ThisWorkbook, since I have formulas on other worksheets refering to this certain worksheet. By deleting the worksheet first, my formulas will end up as #REF. Therefore I have written the following code but this code does not copy charts: Sub Copy_from_another_workbook Dim wb As Workbook Dim sWorksheet As String ThisWorkbook.Worksheets("Destinationsheet").Cells