How to create a shortcut for forward delete?

I'd like to create a shortcut with Ctrl+Backspace or Fn+Backspace or Ctrl+Shift+Backspace which performs a forward delete (the same as the Delete key). I use it (Fn+Backspace) on a Mac and I find it very useful.

Is this feasible?


I don't think this is possible. I tried to do it with xmodmap, but, apparently, it can't catch Fn, so I tried it with the Ctrl and Ctrl+Shift options.

You can see the current behavior of BackSpace using:

xmodmap -pke | grep BackSpace

and the output it gives is:

keycode  22 = BackSpace BackSpace BackSpace BackSpace

The different values correspond to the different modifiers:

1st: no modifier
2nd: shift
3rd: ctrl
4th: ctrl-shift

So we would like to change either the 3rd or the 4th value. We can do this by executing:

xmodmap -e "keycode  22 = BackSpace BackSpace Delete BackSpace"

or:

xmodmap -e "keycode  22 = BackSpace BackSpace BackSpace Delete"

respectively, but unfortunately this does not work for me. I think these values are overridden on some deeper level and both Ctrl+Backspace and Ctrl+Shift+Backspace still deletes a word backwards.

So I think you're stuck just using the Delete key...