How to add custom keystrokes for Cocoa apps

hazmat

Rusher of Din
Sorry if this has been mentioned before. It always kind of pissed me off that Cocoa has built-in Unix keystrokes like ^A, ^E, and ^K, but not ^U to delete the entire line. In another discussion board, I found out how to define your own ones. The following in ~/Library/KeyBindings/DefaultKeyBinding.dict will make ^u delete the entire line, wherever the cursor is, and ^w will delete from the cursor to the beginning of the line. As if you thought OS X coudn't get any cooler.... :)

Code:
< ?xml version="1.0" encoding="UTF-8"? >
< !DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd" >
< plist version="0.9" >
< dict >
< key >^u< /key >
 < array >
   < string >moveToBeginningOfParagraph:< /string >
   < string >deleteToEndOfParagraph:< /string >
 < /array >
< key >^w< /key >
< string >deleteToBeginningOfParagraph:< /string >
< /dict >
< /plist >


You'll have to kill the spaces around the angled brackets since I couldn't figure out a way to make it accept them as text. Anyone know?
 
Back
Top