Question

I'm trying to create a new input method using Input Method Kit. The documentation is very lacking, but I believe I'm setting the project up correctly and I place the input method into ~/Library/Input Methods after building it. However, I see strange behavior when looking at the list of input sources in Language & Text preferences.

The NumberInput sample seems to work fine for me, and there are no differences in my new input method that I can find, aside from the values for tsInputMethodIconFileKey, InputMethodConnectionName, InputMethodServerControllerClass, and CFBundleIdentifier in Info.plist. But I'm seeing these issues:

  • When I use my desired bundle identifier for the app, nothing shows up in the list. (This bundle ID doesn't exist anywhere else on my system.)
  • Changing the bundle identifier to be the same as the NumberInput sample makes it show up in the list, but when I select it, it sometimes duplicates entries in the list, and generally behaves weirdly.
  • As I make slight modifications to the bundle identifier, it seems to behave normally, but once I change it back to the original identifier (the desired one) it disappears from the list.
  • If I quit the process associated with my input method, selecting it in the menu again doesn't relaunch it.

Does anyone have any idea what's going on? Apple's documentation for IMKit is nearly nonexistant and it doesn't seem like many people have documented their own attempts at making input methods. Is there something I'm missing?

Thanks in advance!

P.S. Yes I've tried logging out and back in and even restarting my computer, nothing seems to significantly change the behavior I mentioned above.

Was it helpful?

Solution

This worked for me. Try this: make sure your bundle identifier contains "inputmethod" somewhere in the path. Example "com.blugs.inputmethod.IPAPalette". Yes AFAIK it's totally undocumented. Yes the documentation is awful. Hope this helps! Cheers.

OTHER TIPS

The accepted answer here is very useful, adding .inputmethod. to your Bundle ID.

I'll add that I found a bit of documentation for this in TextInputSources.h, which contains a large number of comments and documentation not found in the Input Method Kit overview docs. Worth a read.

Carbon > Frameworks > HIToolbox > TextInputSources.h

In the Info.plist file, the value for the CFBundleIdentifier key must be a string that includes ".keyboardlayout."; typically this might be something like "com.companyname.keyboardlayout.MyKeyboardLayouts" (Before Leopard, it was required to be a string that began "com.apple.keyboardlayout", even for keyboard layouts not supplied by Apple).

and

If this key is not specified, an InputSourceID will be constructed by combining the BundleID with an InputModeID suffix formed by deleting any prefix that matches the BundleID or that ends in ".inputmethod."

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top