Unicode and custom input methods in Wunderkammer (#4: Custom input method)

Step 3: Custom input method.

First of all, you will need to add your custom input method into the code of the MenulessTextField class in the source code of Wunderkammer. This can be done in any text editor, but as you will need to compile the whole thing later anyway, its probably better to do everything in NetBeans or another Java IDE right from the beginning. You can find the whole MenulessTextField class with the custom Tura-French input method here.

There are only a few things that you are likely to need to modify. Thus, you will probably want to customize the mappings for low case (see picture) and upper case letters onto a typical 3×4 mobile phone keypad. The <\uXXXX> sequences are the unicodes for every special character (I added the characters themselves as comments in green to make things clear).

The low case mappings of the Tura custom input method

Furthermore, you might wish to modify the part “\ue003\ue004\ue005” in brackets after TextField.addInputMode and TextField.setDefaultInputModeOrder, which stands for <ɛ̀ɛ̂ɛ́>. This is just the way I chose to indicate the low case Tura custom input method at the right end of the search box in WK, similar to “Abc” or “123”.

When you are done with adding your custom input method, build the WK project in NetBeans (there is a button for this in NetBeans). To update the WK binaries in wkimporting, all you need to do is replace all the files in the directory wkimporting/bundle/build/preverified with all the preverified binaries from the project. So build the project and then go to build/preverified and copy everything except the ‘META-INF’ and ‘res’ directories to wkimporting/bundle/build/preverified.

Basically, that’s it. Now, after you import the dictionary into WK, you should get a dictionary with the custom input method you defined.

Leave a Reply