For historical reasons I would like to bind f3 to "close window" command. I tried to record a macro, but as soon as I hit apple-w, the window obviously closes but also the macro recording does abort. It would be simple if I could just add in the bundle editor a macro doing "closeWindow" (I assume that is the name of the command).
Cheers, Fons.
Fons Rademakers wrote:
For historical reasons I would like to bind f3 to "close window" command. I tried to record a macro, but as soon as I hit apple-w, the window obviously closes but also the macro recording does abort. It would be simple if I could just add in the bundle editor a macro doing "closeWindow" (I assume that is the name of the command).
I have no idea whether this is possible, my initial guess would be that it is pretty hard, because it is probably a system call.
It is probably easier to use OS X' ability to bind keys to menu actions either globally or for a specific application, see System Preferences, Keyboard & Mouse, Keyboard Shortcuts.
Jeroen.
Fons Rademakers wrote:
For historical reasons I would like to bind f3 to "close window" command.
You want to bind the "performClose:" selector to F3. The way to do this is to put the following file as ~/Library/KeyBindings/DefaultKeyBinding.dict
{ "\UF706" = "performClose:"; }
Now every application with Cocoa text widgets can use F3 for close.
To learn more, see my article about keybinding:
http://hcs.harvard.edu/~jrus/Site/Cocoa%20Text%20System.html
-Jacob