How can I remap CTRL-h in Mac OS X?
8,818
Solution 1
The default ⌃H
behavior comes from the Standard Key Bindings file in the AppKit framework resources. You can override this easily.
Create a file with this as the contents:
{ "^h" = ""; }
And save it to ~/Library/KeyBindings/DefaultKeyBinding.dict
, creating the KeyBindings folder if it doesn't exist. (Note: you will need to restart your applications for this to start working.)
(Another side note: I'm not entirely sure if using ""
is the right way to make it do nothing, but it works. The documentation I found said nothing about any no-op methods.)
Solution 2
DoubleCommand will let you do this.
Related videos on Youtube
Comments
-
Justin Tanner over 1 year
I'd like to remap CTRL + H from delete to nothing in Leopard.
-
Assembler over 14 yearsDid you try to fix it for the emacs command-line client? Aquamacs? or what?
-
Justin Tanner almost 13 yearsWas trying to get emacsformacosx.com to work. Still no luck.
-
-
Justin Tanner over 14 yearsI tried double command but it froze my keyboard completely
-
Justin Tanner over 14 yearsLooks like you can use "noop:" as nothing. Interesting but install can't get this to override the system behavior
-
Assembler over 14 yearsI'm absolutely sure it works for me. Are you sure you're restarting your applications? Maybe try logging out and back in, or restarting your computer. Note, this will only work in apps which use the normal OS X text entry, no old nasty Carbon apps, I'm pretty sure.
-
Assembler over 14 yearsAlso make sure you're putting it in the right place, your library folder. A good way to test would be to change it to
"^h" = ("insertText:", "ctrl-h pressed");
temporarily, or testing things besides^h
. (I think "noop:" only works because it's not actually a method, so nothing happens.) -
Justin Tanner over 14 yearsOkay good i was able to remap ^h for most apps except emacs 23.1 ( the app i really cared about ), which is cocoa i believe.