WebKit.InputMethodContext¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
|||
r/w |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted when a complete input sequence has been entered by the user. |
|
Emitted when the input method wants to delete the context surrounding the cursor. |
|
Emitted whenever the preedit sequence currently being entered has changed. |
|
Emitted when a preediting sequence has been completed or canceled. |
|
Emitted when a new preediting sequence starts. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class WebKit.InputMethodContext(**kwargs)¶
- Bases:
- Abstract:
Yes
- Structure:
Base class for input method contexts.
WebKit.InputMethodContext
defines the interface to implement WebKit input methods. The input methods are used by WebKit, when editable content is focused, to map from key events to Unicode character strings.An input method may consume multiple key events in sequence and finally output 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.
New in version 2.28.
- filter_key_event(key_event)¶
- Parameters:
key_event (
Gdk.Event
) – the key event to filter- Returns:
- Return type:
Allow key_event to be handled by the input method.
If
True
is returned, then no further processing should be done for the key event.New in version 2.28.
- get_input_hints()¶
- Returns:
the
WebKit.InputHints
of the input associated with self- Return type:
Get the value of the
WebKit.InputMethodContext
:input-hints
property.New in version 2.28.
- get_input_purpose()¶
- Returns:
the
WebKit.InputPurpose
of the input associated with self- Return type:
Get the value of the
WebKit.InputMethodContext
:input-purpose
property.New in version 2.28.
- get_preedit()¶
- Returns:
- text:
location to store the preedit string
- underlines:
location to store the underlines as a
GLib.List
ofWebKit.InputMethodUnderline
- cursor_offset:
location to store the position of cursor in preedit string
- Return type:
(text:
str
orNone
, underlines: [WebKit.InputMethodUnderline
], cursor_offset:int
)
Get the pre-edit string and a list of
WebKit.InputMethodUnderline
.Get the current pre-edit string for the self, and a list of
WebKit.InputMethodUnderline
to apply to the string. The string will be displayed inserted at cursor_offset.New in version 2.28.
- notify_cursor_area(x, y, width, height)¶
- Parameters:
Notify self that cursor area changed in input associated.
New in version 2.28.
- notify_focus_in()¶
Notify self that input associated has gained focus.
New in version 2.28.
- notify_focus_out()¶
Notify self that input associated has lost focus.
New in version 2.28.
- notify_surrounding(text, length, cursor_index, selection_index)¶
- Parameters:
Notify self that the context surrounding the cursor has changed.
If there’s no selection selection_index is the same as cursor_index.
New in version 2.28.
- reset()¶
Reset the self.
This will typically cause the input to clear the preedit state.
New in version 2.28.
- set_enable_preedit(enabled)¶
- Parameters:
enabled (
bool
) – whether to enable preedit
Set whether self should enable preedit to display feedback.
New in version 2.28.
- set_input_hints(hints)¶
- Parameters:
hints (
WebKit.InputHints
) – aWebKit.InputHints
Set the value of the
WebKit.InputMethodContext
:input-hints
property.New in version 2.28.
- set_input_purpose(purpose)¶
- Parameters:
purpose (
WebKit.InputPurpose
) – aWebKit.InputPurpose
Set the value of the
WebKit.InputMethodContext
:input-purpose
property.New in version 2.28.
- do_filter_key_event(key_event) virtual¶
- Parameters:
key_event (
Gdk.Event
) – the key event to filter- Returns:
- Return type:
Allow key_event to be handled by the input method.
If
True
is returned, then no further processing should be done for the key event.New in version 2.28.
- do_get_preedit() virtual¶
- Returns:
- text:
location to store the preedit string
- underlines:
location to store the underlines as a
GLib.List
ofWebKit.InputMethodUnderline
- cursor_offset:
location to store the position of cursor in preedit string
- Return type:
(text:
str
orNone
, underlines: [WebKit.InputMethodUnderline
], cursor_offset:int
)
Get the pre-edit string and a list of
WebKit.InputMethodUnderline
.Get the current pre-edit string for the context, and a list of
WebKit.InputMethodUnderline
to apply to the string. The string will be displayed inserted at cursor_offset.New in version 2.28.
- do_notify_cursor_area(x, y, width, height) virtual¶
- Parameters:
Notify context that cursor area changed in input associated.
New in version 2.28.
- do_notify_focus_in() virtual¶
Notify context that input associated has gained focus.
New in version 2.28.
- do_notify_focus_out() virtual¶
Notify context that input associated has lost focus.
New in version 2.28.
- do_notify_surrounding(text, length, cursor_index, selection_index) virtual¶
- Parameters:
Notify context that the context surrounding the cursor has changed.
If there’s no selection selection_index is the same as cursor_index.
New in version 2.28.
- do_preedit_changed() virtual¶
- do_preedit_finished() virtual¶
- do_preedit_started() virtual¶
- do_reset() virtual¶
Reset the context.
This will typically cause the input to clear the preedit state.
New in version 2.28.
Signal Details¶
- WebKit.InputMethodContext.signals.committed(input_method_context, text)¶
- Signal Name:
committed
- Flags:
- Parameters:
input_method_context (
WebKit.InputMethodContext
) – The object which received the signaltext (
str
) – the string result
Emitted when a complete input sequence has been entered by the user. This can be a single character immediately after a key press or the final result of preediting.
New in version 2.28.
- WebKit.InputMethodContext.signals.delete_surrounding(input_method_context, offset, n_chars)¶
- Signal Name:
delete-surrounding
- Flags:
- Parameters:
input_method_context (
WebKit.InputMethodContext
) – The object which received the signaloffset (
int
) – the character offset from the cursor position of the text to be deleted.n_chars (
int
) – the number of characters to be deleted
Emitted when the input method wants to delete the context surrounding the cursor. If offset is a negative value, it means a position before the cursor.
New in version 2.28.
- WebKit.InputMethodContext.signals.preedit_changed(input_method_context)¶
- Signal Name:
preedit-changed
- Flags:
- Parameters:
input_method_context (
WebKit.InputMethodContext
) – The object which received the signal
Emitted whenever the preedit sequence currently being entered has changed. It is also emitted at the end of a preedit sequence, in which case
WebKit.InputMethodContext.get_preedit
() returns the empty string.New in version 2.28.
- WebKit.InputMethodContext.signals.preedit_finished(input_method_context)¶
- Signal Name:
preedit-finished
- Flags:
- Parameters:
input_method_context (
WebKit.InputMethodContext
) – The object which received the signal
Emitted when a preediting sequence has been completed or canceled.
New in version 2.28.
- WebKit.InputMethodContext.signals.preedit_started(input_method_context)¶
- Signal Name:
preedit-started
- Flags:
- Parameters:
input_method_context (
WebKit.InputMethodContext
) – The object which received the signal
Emitted when a new preediting sequence starts.
New in version 2.28.
Property Details¶
- WebKit.InputMethodContext.props.input_hints¶
- Name:
input-hints
- Type:
- Default Value:
- Flags:
The
WebKit.InputHints
of the input associated with this context.New in version 2.28.
- WebKit.InputMethodContext.props.input_purpose¶
- Name:
input-purpose
- Type:
- Default Value:
- Flags:
The
WebKit.InputPurpose
of the input associated with this context.New in version 2.28.