public abstract class InputMethod extends Object
In GTK, these are GtkIMContext
objects. This class and its
concrete subclasses are presented here according to the Java naming
conventions.
Modifier and Type | Class and Description |
---|---|
static interface |
InputMethod.Commit
Signal emitted when the input method completes its composition.
|
Modifier and Type | Method and Description |
---|---|
void |
connect(InputMethod.Commit handler)
Hookup a
InputMethod.Commit handler. |
boolean |
filterKeypress(EventKey event)
Find out whether the input method has handled a keystroke, or whether
it needs to be further handled or propegated.
|
void |
setUsePreedit(boolean setting)
How hould the InputMethod provide feedback to the user?
|
public void connect(InputMethod.Commit handler)
InputMethod.Commit
handler.public boolean filterKeypress(EventKey event)
This is for use in Widget.KeyPressEvent
and
Widget.KeyReleaseEvent
handlers when hooking up an input
method to a Widget, where the code will look something like:
drawing.connect(new Widget.KeyPressEvent() { public boolean onKeyPressEvent(Widget source, EventKey event) { if (input.filterKeypress(event)) { return true; } // or carry on with your logic, if (doSomething()) { return true; } // otherwise progegate the keystroke up to the default handler return false; } });You need to do call this for both key presses and releases (at least, for the default input method to work right, anyway).
public void setUsePreedit(boolean setting)
true
, which is to ask the Widget to display in-line,
communicating the preedit string via the signal handlers. Otherwise,
the InputMethod can attempt to use some alternative (internal) means.