12

My question is in the title: does OS X allow to set a shortcut with backspace, like Ctrl+Option ⌥+Command ⌘+backspace (in my case to an Automator service)?

Edit:
You might think "Try it yourself"; well, I did it. In System Preferences → Keyboard → Shortcuts, I tried to add this shortcut to my service and it doesn't work. The problem seems to be with backspace. Ctrl+Option ⌥+Command ⌘+m works well.

Does anybody know a workaround that allows me to use the backspace key in a keyboard shortcut?

3
  • If you want, you can add your findings as an answer to keep the site organised. Oct 30, 2013 at 20:29
  • Actually my question was to know if there was maybe a work around for this. Oct 30, 2013 at 20:32
  • Ah sorry, I misunderstood. I thought you just wanted to know if the shortcut could include the backspace key or not. Oct 30, 2013 at 21:09

4 Answers 4

6

To change the shortcut of a service, run plutil -convert xml1 ~/Library/Preferences/pbs.plist, open the plist, and change for example

<key>(null) - Some Service - runWorkflowAsService</key>
<dict>
    <key>key_equivalent</key>
    <string>@~a</string>
</dict>

to

<key>(null) - Some Service - runWorkflowAsService</key>
<dict>
    <key>key_equivalent</key>
    <string>@~&#x8;</string>
</dict>

Then restart to apply the changes.

@ is command, ~ is option, and &#x8; is delete (Windows backspace). Forward delete (Windows delete) would be &#x7f;. The shortcut strings use the same format as in DefaultKeyBinding.dict.

To change a global shortcut set in the App Shortcuts section, run plutil -convert xml1 ~/Library/Preferences/.GlobalPreferences.plist, open the plist, and change for example

<key>Some Menu Name</key>
<string>~@a</string>

to

<key>Some Menu Name</key>
<string>~@&#x8;</string>

Then quit and reopen applications to apply the changes.

Application-specific shortcuts are stored in ~/Library/Preferences/*.plist and ~/Library/Containers/*/Data/Library/Preferences/*.plist.

2
  • I don't know if yosemite treats this file differently, or if my issue is specific to chrome, but I cannot get this to work. Saving the file with the new key binding doesn't propagate to the keyboard shortcut preferences, nor does it show up in chrome's menu. A warning to hotkey-heavy folks like myself, I have found a lot of difficulty trying to customize my keyboard shortcuts throughout OSX (coming from windows & linux). Although it seems as though there is a lot of opportunity for fine-grained customization, I'm finding a ton of bugs within OSX keybindings as a whole.
    – aaaaaa
    Sep 25, 2015 at 18:10
  • Note that you must remove or re-assign any other bindings to the same keys, otherwise it will not work
    – wrossmck
    May 9, 2019 at 16:40
3

The favorite answer here is substantially correct. However, pasting &#x8; for Backspace didn't work for me. It wound up as 8 in the menu. The technique that worked for me was to open the Emoji and Symbols viewer.

You can follow the instructions in that answer up to the point where you need to type this string, and then use the instructions below:


You can press Control-Command-Space, or if that keyboard shortcut doesn't work, you can activate a menu from the Keyboard section of the Keyboard system preference pane by checking "Show keyboard and emoji viewers in menu bar."

  1. Use the shortcut, or from the menu bar, find the keyboard and emoji input menu icon for the keyboard and emoji input menu item and choose "Show Emoji and Symbols."
  2. By default, you'll see the Emoji window. In the top-right corner you'll see the same icon, which you can click to switch to the Symbols viewer.
  3. From the list on the left, choose Technical Symbols.
  4. Look for the symbol for "Erase to the left" (Erase to the Left symbol), which for me appears at the beginning of the third row.
  5. Make sure your text insertion point is positioned where you want to insert the symbol.
  6. Double-click on the symbol to insert it into the text.

From there you can save your plist and continue with the instructions from the original answer.

Also note that if you have Xcode installed, or another app that can read and edit plist files natively, you don't have to convert the plist to XML.

1
  • You may need to use Customize List to even see Technical Symbols on the left.
    – Mark Adler
    Mar 29, 2022 at 22:50
0

While it's not free, Keyboard Maestro will solve your problem.

Here's a very simple example: Just set the Hot Key to ⌘Delete (by pressing ⌘+⌦) and assign a menu item for it to activate. You can also specify the applications that the shortcut will work in, so you can reuse the trigger.

Keyboard Maestro Macro

Of course, given that's it's a very powerful macro program, you can set it to do much more complicated tasks—from running Applescripts to manipulating Markdown.

0
  • Step 1 - get karabiner (if it's not already on your mac, which it might be).
  • Step 2 - open Karabiner
  • Step 3 - go to "change backslash key"
  • Step 4 - click "change backslash to forward delete / + (Fn+backslash to backslash"
  • Step 5 - close window.

This makes the backslash key the delete key. I never use backslash, so it works great for me. Hope this helps.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .