3

I'm using Ubuntu 19.10. What action do I use to map Ctrl+Backspace to delete one character?

I tried del, delete, <del>, <delete>...

Any help is welcome.

Overbeeke
  • 131
  • xbindkeys have you tried but you need to simulate with xdotool like xdotool key Delete. And its bit slow. Not worthy but try once. – PRATAP Nov 09 '19 at 17:13
  • This question gives you clue what i mean in above comment. https://askubuntu.com/q/1100493/739431 – PRATAP Nov 09 '19 at 17:17

1 Answers1

4

A simple and reliable way to do that is using the AutoKey application. Just follow these steps:

  1. Install autokey and the GUI package for the respective desktop environment you use (autokey-gtk for GTK-based environments (like GNOME, Xfce, Mate) or autokey-qt for QT-based environments (like KDE, LXQt)):

    sudo apt install autokey-common autokey-gtk
    

    or:

    sudo apt install autokey-common autokey-qt
    
  2. Open AutoKey and go to FileNewPhrase.

  3. In the widow that pops up enter a name for the phrase and click OK. I'm using Map Ctrl+Back for the phrase's name.

  4. Select the Map Ctrl+Back phrase on the left sidepane (should be under My Phrases) and in the main text box enter:

    <delete>
    
  5. On the bottom panel click Set on the Hotkey option → click Press to Set and press Ctrl+Backspace.

  6. Save your phrase by clicking Save on the menu bar of the AutoKey window.

That's it! You should now be able to press Ctrl+Backspace to send Delete keystrokes.


Note: It is recommended to have AutoKey autostart when you log in to your desktop, so that you don't have to manually start it every time. To do that go to EditPreferences and check Automatically start AutoKey at login.

  • A couple of additions. If you select the autostart option and your desktop has already started it as part of restoring the last session, you get an annoying error message and you will need to disable one or the other options, Also, if you need this mapping for some applications, but not others, you can set an appropriate window filter for your script or phrase. – Joe Feb 12 '23 at 14:10