1

I would like to map the right option key and the backspace key to forward delete, mostly so that I can forward delete whilst holding a cup of coffee without doing hand acrobatics. Could somebody please help me with this? I'm a Windows user so a bit out of my comfort zone.

I've looked at Karabina, which looks promising on the surface but it turns out you cannot set multi key stroke commands as shortcuts and can only download from a list of preconfigured shortcuts on the internet (terrible design if you ask me!).

2 Answers 2

1

The previous answer is not quite correct.

"\UF728" is for "forward delete" (our goal), we need "\U007F" here.

To use Option + Delete as regular del button put this code into ~/Library/KeyBindings/DefaultKeyBinding.dict

{
    "~\U007F" = "deleteForward:";
}

And restart an app to apply changes in this app.

If you want to use Shift + Delete as del, use this code:

{
    "$\U007F" = "deleteForward:";
}

Check this link for details: http://xahlee.info/kbd/osx_keybinding_key_syntax.html

0

Keyboard Maestro is the easiest option but it does not allow you to specify right option as it does not distinguish right and left versions of buttons. To do this you must use the Karabiner solution.

Keyboard Maestro

Create a new macro in Keyboard Maestro. Trigger the macro by the option This hot key: and input Delete. Add a new action of type Type a Keystroke. Input fndelete for the keystroke.

DefaultKeyBinding.dict

Navigate to ~/Library/KeyBindings (Open finder then Press shiftG and paste that path). Add a folder named DefaultKeyBinding.dict with the code:

{
    "~\UF728" = deleteForward:;
}

If you want more information check out this great explanation of the DefaultKeyBinding.dict feature and the cocoa text system and the apple developer page for a list of commands that should work on any Cocoa text application. You may have to restart the application you are using to get this working.

For the most comprehensive list of possible commands for this feature check out osxnotes.net on the wayback machine.

Karabiner/Goku

You actually can create your own multi key stroke commands as shortcuts with Karabiner. They can be created by manually editing the karabiner configuration file.

However the configuration file is both difficult to read (written in JSON) and arguably very verbose. Goku provides a simpler [edn format] configuration option that it then compiles into karabiner-readable JSON.

karabiner.json

karabiner.json

karabiner.edn

karabiner.edn

Karabiner actually captures and modifies input events at a low level, before they are interpreted by the operating system. It is a very powerful tool, allowing switchable modes, variables, application specific behavior, and triggering/reading output of system scripts among other things.

You must log in to answer this question.

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