How can I prevent shift-delete from cutting in Windows?

8

I want to prevent Shift-delete from putting the selected stuff to the buffer - it overwrites what I already have in the clipboard, which is a problem, because I always use Ctrl+X for cutting and Shift+Delete only happens when I'm editing stuff and just want to delete it (shift remains pressed after selecting something).

Fluffy

Posted 2011-03-11T16:37:30.880

Reputation: 712

For years, I wondered why my clipboard copied stuff were being randomly replaced by things I deleted, and I finally discovered it's because of this cursed key shortcut. – Leonardo Raele – 2020-01-07T00:47:15.007

2You could also use a (multi-)clipboard management program so that you can go back and select/restore earlier items. – Synetech – 2011-03-13T18:41:27.707

3I feel your pain, roddik. This bothers me so much. – Ronnie Overby – 2011-10-12T18:59:15.337

Answers

2

* SOLUTION *

I just discovered this problem today while trying to figure out why the 'delete' key would sometimes 'copy to clipboard'. So far the only solution I've found is to use AutoHotKey (free).

So I thought I would post some basic setup instructions for anyone else that's interested in a solution to this problem:

First, install AutoHotKey, run it and allow it to create and open the example/default AutoHotkey.ahk script when it prompts you. Add the following to the script:

+Delete::
KeyWait Shift
Send {Delete}

I'm not sure but you may have to "reload" the script before it starts working (I reloaded before testing). To reload, bring the AutoHotKey app to the foreground and press Ctrl+R (or click File -> Reload Script).

If you're happy with the results then you'll probably want to setup AutoHotKey to run automatically on startup. This is done by selecting the AutoHotkey.ahk file (in your 'My Documents' folder) and then going to your startup folder (C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup) and clicking "Paste Shortcut" from the "Edit" menu (Press Alt+E if you don't see a menu bar).

In testing, this fix worked great for me on Windows 7. I'll be posting this same solution under my own post but since I'm a new user it won't let me answer my own question yet.

Jeremy

Posted 2011-03-11T16:37:30.880

Reputation: 616

1

Try using Backspace. If Shift is still held down, it will still work and the selected text will be deleted without affecting what's in the clipboard.

Paused until further notice.

Posted 2011-03-11T16:37:30.880

Reputation: 86 075

0

Slight improvement to the above response provided by Jeremy:

+Delete::
    tempClipboard := Clipboard
    Send +{Delete}
    Clipboard = %tempClipboard%
    VarSetCapacity(tempClipboard, 0)
Return

This will disable the keyboard shortcut from cutting text, but it will still work in other cases, such as deleting a file without first sending it to the recycling bin.

Joshua C McMahon

Posted 2011-03-11T16:37:30.880

Reputation: 1