Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I use Preview to view PDF files (duh) and sometimes annotate them as well as search them profusely. I keep using the Command-Backspace combination to try to delete the current line I'm writing in the annotation or to clear the search box, but to my dismay it sends the currently open PDF file to the trash!

I'm used to Command-Backspace deleting the whole line in other, more write or text input oriented, software, such as TextEdit even (which I don't really use, but it is another OSX default, so I'd think some consistency is to be expected?)

Is there any way to disable this keyboard shortcut in Preview? I don't even need it to do what I expect it to, I just want it to stop deleting my files!

share|improve this question
    
Ack I did it again not two seconds after posting this, hahaha I suck. –  gakera Dec 14 '10 at 17:37
    
(As an aside: officially that is called Delete on a Mac, not Backspace.) –  Arjan Dec 14 '10 at 20:37
    
@Arjan ugh, as a migrating windows user I don't care about the historical semantics of the Apple keyboard. Backspace is backspace, forward delete is delete which incidentally is fn-backspace on my mbp keyboard. The damn option thing pisses me off to no end, the key is labeled with that broken lazer line thing (pew pew) and also with an "alt" but everybody keeps talking about "option" which is nowhere to be found. And Ctrl as ^ ugh, fml –  gakera Dec 15 '10 at 13:51
    
but everybody keeps talking about "option" which is nowhere to be found -- exactly the reason why I mentioned it, as an aside. When not knowing the official names, things can get more complicated than needed. That's all! –  Arjan Dec 15 '10 at 15:06
    
I think this is the start of a long surrender on apple's part, since they're now labeling the alt button as such, and the backspace is just an <- arrow. The official vernacular is bound to change as well. The Command button I can live with, but they might as well just call it the mac button, lol –  gakera Dec 15 '10 at 15:58
show 1 more comment

3 Answers

up vote 4 down vote accepted

In System Preferences > Keyboard > Keyboard Shortcuts, add a shortcut for Preview (Move Selected PDF Document to Trash) that you are unlikely to type inadvertently, something like ^ ⌥ ⇧⌘ ⎋.

Add Preview Keyboard Shortcut

share|improve this answer
    
Funny Preview developers: the command could be Move to Trash, Move Selected PDF Document to Trash, Move Selected Image to Trash, ...? –  Arjan Dec 14 '10 at 20:09
    
Yes, absoutely! –  0xced Dec 14 '10 at 23:14
    
Thanks, that works great –  gakera Dec 15 '10 at 13:41
add comment

KeyRemap4MacBook? I have no experience with it, just saw it float by today on MacUpdate. From the description, it should let you do what you want. At the very least it's free, so you're only out your time if it doesn't pan out.

share|improve this answer
3  
This is not application specific, and, if it worked (which I doubt), would break Cmd-Backspace in Finder, Transmit, etc. –  Daniel Beck Dec 14 '10 at 19:37
add comment

As an alternative to assigning a different (difficult) shortcut to the menu item, you can assign the Cmd-Delete combination to a harmless menu item, such as Edit » Spelling » Check Spelling as You Type.

The difference is, something harmless happens when you press your shortcut, but no matter what unlikely combination of keys you press, it will never perform the delete operation.

Additionally, the answer with the difficult shortcut only works for the specific PDF menu item variant, not on all variants of the item (e.g. Move Selected Image to Trash). It depends on which behavior you prefer.


The problem is: It's not possible to type Delete/Backspace in the dialog where you assign custom shortcuts. You need to do this via the command line in /Applications/Utilities/Terminal.app:

defaults write com.apple.Preview NSUserKeyEquivalents -dict-add "Check Spelling as You Type" "@\U0008"

The result:

alt text


Many thanks to @Arjan for his collaboration on this completely revised answer.

share|improve this answer
    
Funny Preview developers: the command could be Move to Trash, Move Selected PDF Document to Trash, Move Selected Image to Trash, ...? –  Arjan Dec 14 '10 at 20:10
    
@Arjan Depending on what kind of document is opened. Makes sense, somewhat, even if it makes remapping more difficult and my answer probably wrong (I didn't expect this and tested with multiple image files). –  Daniel Beck Dec 14 '10 at 20:30
    
I wonder if there's some harmless command that one could map Command-Delete to, instead of trying to map Move .. to Trash command to some other key combination... –  Arjan Dec 14 '10 at 20:35
    
@Arjan The problem is that he presses the combination, therefore executing the command. Even opening the inspector would be performed; and the default shortcut (Cmd-I-ish) removed (which is another annoyance). One could edit the nib using the developer tools in earlier versions to remove the shortcut or move it to another command, but this isn't possible anymore ("compiled nib"). Another option would be to intercept the shortcut globally using one of the hotkey managers, but this is, as mentioned, global, leading to Finder and general editor breakage. –  Daniel Beck Dec 14 '10 at 20:45
2  
Another nice option: remove it altogether! Like: defaults write com.apple.Preview NSUserKeyEquivalents -dict-add "Move to Trash" nil (and repeat for the other two menu names that we have found...) –  Arjan Dec 15 '10 at 20:04
show 29 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.