4

I'd like to remap CTRL + H from delete to nothing in Leopard.

Jasper
  • 213
  • 3
  • 14
Justin Tanner
  • 645
  • 4
  • 11
  • 18

3 Answers3

5

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.)

jtbandes
  • 8,800
  • 3
  • 45
  • 70
  • Looks like you can use "noop:" as nothing. Interesting but install can't get this to override the system behavior – Justin Tanner Aug 28 '09 at 04:05
  • I'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. – jtbandes Aug 28 '09 at 05:40
  • 1
    Also 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.) – jtbandes Aug 28 '09 at 05:42
  • Okay 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. – Justin Tanner Sep 02 '09 at 02:32
1

DoubleCommand will let you do this.

John T
  • 163,373
  • 27
  • 341
  • 348
0

If DoubleCommand isn't working for you you could try creating your own keyboard layout using something like Ukelele. I've never done it though, so i'm not sure how much work it is.

Alex.Bullard
  • 311
  • 1
  • 6