InputManagersManager API

Version: 1.09

Introduction

InputManagersManager tries to simplify creation of application plugins for developers.

Simple InputManager

In the simplest case, all InputManagersManager requires is a simple bundle with no special configuration. Such a bundle can be installed by dropping it onto the InputManagersManager dock icon while keeping the Alt and Cmd keys pressed. The classes contained in the InputManager can initialize themselves using the +load method.

Optionally you can set the principal class within the plist. If that class responds to the +install method, InputManagersManager's bundle loader will call that method.

Double-clickable InputManagers

The user experience can be enhanced by a very simple measure: Change the extension of your bundle from .bundle to .IMMbundle. This allows for installation of the bundle by simply double-clicking it.

To change the bundle extension, in Xcode right-click the bundle within the Targets smart group and select Get Info. In the build tab find the Wrapper Extension property, and change it's value from bundle to IMMbundle.

Tip: With a little setup, debugging InputManagers is easy. Configure your InputManager to only load in the application you want to test with (you can use InputManagerManager to do that). This is so that other applications do not pick up your in-development bundle. Once installed, your bundle will be at ~/Library/Application Support/InputManagerManager/Bundles. Delete your bundle and instead add a symbolic link to where Xcode puts the debug version of your bundle. Next add the desired target application to the Executables smart group in Xcode. Now you can modify your bundle and run or debug the target application (and with it your bundle) from within Xcode.

InputManagers for selected Applications

It is easy to configure your IMMbundle to only be loaded in selected applications, or to exclude it from selected applications. To do so edit the bundle's Info.plist file and add an IMMInfo dictionary containing these keys and values:

Example: The IMMInfo example below is for a bundle that is designed to only work in Safari:


	<dict>
		<key>apps</key>
		<array>
			<dict>
				<key>Name</key>
				<string>Safari</string>
			</dict>
		</array>
		<key>disableForApps</key>
		<false/>
		<key>appsEditable</key>
		<false/>
	</dict>

Configure bundle (optional)

Some InputManagers require some configuration before they are first used. InputManagersManager supports that by looking for a bundle named Configure.bundle within your InputManagers Resources. If found, InputManagersManager will load that bundle during installation or upgrade, look for the principal class, and (if present) call a method inside that bundle with the signature +(BOOL)configure:sender. sender is unused at current. The method must return a bool value. If the returned value is NO, InputManagersManager will not install the bundle. The configure: method could for example run a modal panel, allowing the user to configure certain settings.

Note: As InputManagersManager might install or delete multiple bundles without being restarted, it is important that you choose unique names for all classes inside your Configure and Delete bundles, for example by prefixing all class names with the name of your InputManager. Do NOT simply name them Configure and Delete!!!

Delete bundle (optional)

This works similarly to the Configure bundle, see there for more information. The bundle name is expected to be Delete.bundle, and the called method is +(BOOL)delete:sender. If this method returns NO, InputManagersManager assumes that deletion failed and will warn the user.

Note: As InputManagersManager might install or delete multiple bundles without being restarted, it is important that you choose unique names for all classes inside your Configure and Delete bundles, for example by prefixing all class names with the name of your InputManager. Do NOT simply name them Configure and Delete!!!