Enable input method in Clutter application

terminology

When we mention clutter application in this document, we refer to both of the applications who use clutter library directly or use some high level toolkit base on clutter (for example: NBTK)

common

To enable input method support in clutter application, you need to have the “text” widget be able to work with the ClutterIMContext framework.

For application using Clutter library directly

Currently, the ClutterText actor in clutter library don’t support ClutterIMContext framework directly. If your application is using ClutterText actor for text input, you need to replace it with ClutterIMText actor to gain IM support. We have this actor inherit from the ClutterText actor in the ClutterIMContext library. You can read the API doc for ClutterIMContext library for more information.

For application using NBTK

We have already support ClutterIMContext in NBTK. So in NBTK, text related widget should already support Input Method.

For application using other high level toolkit base on clutter

You should either using ClutterIMText for text widget or patch your text related widget in the similar way we did in NBTK or ClutterIMText

Enable Auto Show/Hide

You might want to have the input method UI auto show/hide upon text widget focus-in/out on a device without a hardware keyboard.

To Enable IM auto show/hide feature for Clutter application. You can modify the global behavior by setting the enviroment parameter:

CLUTTER_IMCONTEXT_AUTOSHOW=TRUE

Or you can also call clutter_imtext_set_autoshow_im to enable/disable the auto show/hide behavior for a specific imtext widget.