3

After doing some work in linux terminals, I got used to the Ctrl + h shortcut acting like the Backspace key.

Now I want to use this shortcut everywhere (not just in terminal).

This is easily done in Windows via Autohotkey, but I can't find a way of globally setting this behaviour on linux.

Most (GUI) applications do nothing after pressing the shortcut and some (I'm looking at you, Firefox) show a useless (for me) sidebar and screw the keyboard focus, which is a rather unpleasant slap in the face.

So, does anyone here know how can I globally map Ctrl + h to Backspace under X?

I tried to look at the xkb keymap files, but without success.

I'm using Gnome and Awesome at the moment, but if it can be done regardless of the window manager, all the better :-).

3 Answers 3

3

(better late than never)

It can be done for gtk applications:

Locate or create ~/.gtkrc-2.0

add the following line:

gtk-key-theme-name = "Emacs"

restart your gtk-app (pidgin. firefox etc) and you will be able to use ctrl-h ctrl-w and ctrl-u for deletion

1
  • In Ubuntu I had to set "/desktop/gnome/interface/gtk_key_theme" to "Emacs" using gconf-edidor to make this work, but, yeah, it does. Thanks! Commented Aug 16, 2009 at 20:05
0

The default behavior for Ctrl+h is Backspace for ASCII-based systems and should not require (re-) definition.

4
  • But it still doesn't work like that under X window with most GUI apps like Firefox, Pidgin, etc. Commented Jul 21, 2009 at 10:49
  • That's a per-application redefinition that particular programs (wrongly) make. Commented Jul 21, 2009 at 10:52
  • Hmm... and is there a way of preventing that? Besides modifying the applications themselves, I mean. Commented Jul 21, 2009 at 11:09
  • From support.mozilla.com/en-US/kb/Keyboard+shortcuts - "Firefox does not provide any method of customizing keyboard shortcuts." Commented Jul 21, 2009 at 11:17
0

After quite a bit of Google searching, I found

XHKeys

which seems to be able to do quite that... There is a long manual there to, I only skimmed through that. So it's up to you to really verify if it works for you.

1
  • Thanks, XHKeys does allow for this kind of customization. The customization works fine for gui and terminal application but it works erratically for web applications within Firefox :/ Commented May 23, 2020 at 13:03

You must log in to answer this question.

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