gtk.imcontext
Module for [IMContext] class
Types 3
gtk.imcontext.IMContext defines the interface for GTK input methods.
gtk.imcontext.IMContext is used by GTK text input widgets like gtk.text.Text to map from key events to Unicode character strings.
An input method may consume multiple key events in sequence before finally outputting the composed result. This is called preediting, and an input method may provide feedback about this process by displaying the intermediate composition states as preedit text. To do so, the gtk.imcontext.IMContext will emit gtk.imcontext.IMContext.preeditStart, gtk.imcontext.IMContext.preeditChanged and gtk.imcontext.IMContext.preeditEnd signals.
For instance, the built-in GTK input method gtk.imcontext_simple.IMContextSimple implements the input of arbitrary Unicode code points by holding down the <kbd>Control</kbd> and <kbd>Shift</kbd> keys and then typing <kbd>u</kbd> followed by the hexadecimal digits of the code point. When releasing the <kbd>Control</kbd> and <kbd>Shift</kbd> keys, preediting ends and the character is inserted as text. For example,
Ctrl+Shift+u 2 0 A C
results in the € sign.
Additional input methods can be made available for use by GTK widgets as loadable modules. An input method module is a small shared library which provides a gio.ioextension.IOExtension for the extension point named "gtk-im-module".
To connect a widget to the users preferred input method, you should use gtk.immulticontext.IMMulticontext.
IMContextGidBuilder builder() static nothrowGet builder for [gtk.imcontext.IMContext] Returns: New builder objectgtk.types.InputHints inputHints() @property nothrowGet `inputHints` property. Returns: Additional hints that allow input methods to fine-tune their behaviour.void inputHints(gtk.types.InputHints propval) @property nothrowSet `inputHints` property. Params: propval = Additional hints that allow input methods to fine-tune their behaviour.gtk.types.InputPurpose inputPurpose() @property nothrowGet `inputPurpose` property. Returns: The purpose of the text field that the `GtkIMContext is connected to.void inputPurpose(gtk.types.InputPurpose propval) @property nothrowSet `inputPurpose` property. Params: propval = The purpose of the text field that the `GtkIMContext is connected to.bool activateOsk(gdk.event.Event event = null) nothrowRequests the platform to show an on-screen keyboard for user input.bool deleteSurrounding(int offset, int nChars) nothrowAsks the widget that the input context is attached to delete characters around the cursor position by emitting the `::delete_surrounding` signal.bool filterKey(bool press, gdk.surface.Surface surface, gdk.device.Device device, uint time, uint keycode, gdk.types.ModifierType state, int group) nothrowAllow an input method to forward key press and release events to another input method without necessarily having a [gdk.event.Event] available.bool filterKeypress(gdk.event.Event event) nothrowAllow an input method to internally handle key press and release events.void focusIn() nothrowNotify the input method that the widget to which this input context corresponds has gained focus.void focusOut() nothrowNotify the input method that the widget to which this input context corresponds has lost focus.void getPreeditString(out string str, out pango.attr_list.AttrList attrs, out int cursorPos) nothrowRetrieve the current preedit string for the input context, and a list of attributes to apply to the string.bool getSurrounding(out string text, out int cursorIndex) nothrowRetrieves context around the insertion point.bool getSurroundingWithSelection(out string text, out int cursorIndex, out int anchorIndex) nothrowRetrieves context around the insertion point.void reset() nothrowNotify the input method that a change such as a change in cursor position has been made.void setClientWidget(gtk.widget.Widget widget = null) nothrowSet the client widget for the input context.void setCursorLocation(gdk.rectangle.Rectangle area) nothrowNotify the input method that a change in cursor position has been made.void setSurrounding(string text, int cursorIndex) nothrowSets surrounding context around the insertion point and preedit string.void setSurroundingWithSelection(string text, int cursorIndex, int anchorIndex) nothrowSets surrounding context around the insertion point and preedit string. This function is expected to be called in response to the `signalGtk.IMContext::retrieve_surrounding` signal, and will likely...void setUsePreedit(bool usePreedit) nothrowSets whether the IM context should use the preedit string to display feedback.gulong connectCommit(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == string)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] : gtk.imcontext.IMContext)))
&& Parameters!T.length < 3) nothrowConnect to `Commit` signal.gulong connectDeleteSurrounding(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == bool)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == int)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] == int)))
&& (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] : gtk.imcontext.IMContext)))
&& Parameters!T.length < 4) nothrowConnect to `DeleteSurrounding` signal.gulong connectPreeditChanged(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.imcontext.IMContext)))
&& Parameters!T.length < 2) nothrowConnect to `PreeditChanged` signal.gulong connectPreeditEnd(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.imcontext.IMContext)))
&& Parameters!T.length < 2) nothrowConnect to `PreeditEnd` signal.gulong connectPreeditStart(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.imcontext.IMContext)))
&& Parameters!T.length < 2) nothrowConnect to `PreeditStart` signal.gulong connectRetrieveSurrounding(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == bool)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.imcontext.IMContext)))
&& Parameters!T.length < 2) nothrowConnect to `RetrieveSurrounding` signal.Fluent builder implementation template for gtk.imcontext.IMContext
T inputHints(gtk.types.InputHints propval) nothrowSet `inputHints` property. Params: propval = Additional hints that allow input methods to fine-tune their behaviour. Returns: Builder instance for fluent chainingT inputPurpose(gtk.types.InputPurpose propval) nothrowSet `inputPurpose` property. Params: propval = The purpose of the text field that the `GtkIMContext is connected to.Fluent builder for gtk.imcontext.IMContext