Extend a Cocoa application
You can use the SIMBL InputManager to selectively load other InputManagers (a.k.a. SIMBL Plugins) when an application launches. See the section Creating A SIMBL Plugin Bundle of Mike Solomon's tutorial on Cocoa Reverse Engineering.