Fcitx.Client

g Fcitx.Client Fcitx.Client GObject.Object GObject.Object GObject.Object->Fcitx.Client

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

class

new_with_connection (connection)

focus_in ()

focus_out ()

is_valid ()

process_key (keyval, keycode, state, type, t, timeout_msec, cancellable, callback, *user_data)

process_key_finish (res)

process_key_sync (keyval, keycode, state, type, t)

reset ()

set_capacity (flags)

set_cursor_rect (x, y, w, h)

set_display (display)

set_surrounding_text (text, cursor, anchor)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

connection

Fcitx.Connection

w/co

Fcitx Connection

Signals

Inherited:

GObject.Object (1)

Name

Short Description

close-im

Emit when input method is closed

commit-string

Emit when input method commit one string

connected

Emit when connected to fcitx and created ic

delete-surrounding-text

Emit when input method need to delete surrounding text

disconnected

Emit when disconnected from fcitx

enable-im

Emit when input method is enabled

forward-key

Emit when input method ask for forward a key

update-client-side-ui

Emit when input method need to update client side ui

update-formatted-preedit

Emit when input method need to delete surrounding text

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Fcitx.Client(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Fcitx.ClientClass

A Fcitx.Client allow to create a input context via DBus

classmethod new()
Returns:

A newly allocated Fcitx.Client

Return type:

Fcitx.Client

New a Fcitx.Client

classmethod new_with_connection(connection)
Parameters:

connection (Fcitx.Connection) – the Fcitx.Connection to be used with this client

Returns:

A newly allocated Fcitx.Client

Return type:

Fcitx.Client

New a Fcitx.Client

focus_in()

tell fcitx current client has focus

focus_out()

tell fcitx current client has lost focus

is_valid()
Returns:

Fcitx.Client is valid or not

Return type:

bool

Check Fcitx.Client is valid to communicate with Fcitx

process_key(keyval, keycode, state, type, t, timeout_msec, cancellable, callback, *user_data)
Parameters:

use this function with Fcitx.Client.process_key_finish

process_key_finish(res)
Parameters:

res (Gio.AsyncResult) – result

Returns:

process key result

Return type:

int

use this function with #fcitx_client_process_key_async

process_key_sync(keyval, keycode, state, type, t)
Parameters:
  • keyval (int) – key value

  • keycode (int) – hardware key code

  • state (int) – key state

  • type (int) – event type

  • t (int) – timestamp

Returns:

the key is processed or not

Return type:

int

send a key event to fcitx synchronizely

reset()

tell fcitx current client is reset from client side

set_capacity(flags)
Parameters:

flags (int) – capacity

set client capacity of Fcitx

set_cursor_rect(x, y, w, h)
Parameters:
  • x (int) – x of cursor

  • y (int) – y of cursor

  • w (int) – width of cursor

  • h (int) – height of cursor

tell fcitx current client’s cursor geometry info

set_display(display)
Parameters:

display (str) –

set_surrounding_text(text, cursor, anchor)
Parameters:
  • text (str or None) – surroundng text

  • cursor (int) – cursor position coresponding to text

  • anchor (int) – anchor position coresponding to text

Signal Details

Fcitx.Client.signals.close_im(client)
Signal Name:

close-im

Flags:

RUN_LAST

Parameters:

client (Fcitx.Client) – The object which received the signal

Emit when input method is closed

Fcitx.Client.signals.commit_string(client, string)
Signal Name:

commit-string

Flags:

RUN_LAST

Parameters:
  • client (Fcitx.Client) – The object which received the signal

  • string (str) – string to be committed

Emit when input method commit one string

Fcitx.Client.signals.connected(client)
Signal Name:

connected

Flags:

RUN_LAST

Parameters:

client (Fcitx.Client) – The object which received the signal

Emit when connected to fcitx and created ic

Fcitx.Client.signals.delete_surrounding_text(client, cursor, len)
Signal Name:

delete-surrounding-text

Flags:

RUN_LAST

Parameters:
  • client (Fcitx.Client) – The object which received the signal

  • cursor (int) – deletion start

  • len (int) – deletion length

Emit when input method need to delete surrounding text

Fcitx.Client.signals.disconnected(client)
Signal Name:

disconnected

Flags:

RUN_LAST

Parameters:

client (Fcitx.Client) – The object which received the signal

Emit when disconnected from fcitx

Fcitx.Client.signals.enable_im(client)
Signal Name:

enable-im

Flags:

RUN_LAST

Parameters:

client (Fcitx.Client) – The object which received the signal

Emit when input method is enabled

Fcitx.Client.signals.forward_key(client, keyval, state, type)
Signal Name:

forward-key

Flags:

RUN_LAST

Parameters:
  • client (Fcitx.Client) – The object which received the signal

  • keyval (int) – key value

  • state (int) – key state

  • type (int) – event type

Emit when input method ask for forward a key

Fcitx.Client.signals.update_client_side_ui(client, auxup, auxdown, preedit, candidateword, imname, cursor_pos)
Signal Name:

update-client-side-ui

Flags:

RUN_LAST

Parameters:
  • client (Fcitx.Client) – The object which received the signal

  • auxup (str) – Aux up string

  • auxdown (str) – Aux down string

  • preedit (str) – preedit string

  • candidateword (str) – candidateword in one line

  • imname (str) – input method name

  • cursor_pos (int) – cursor position

Emit when input method need to update client side ui

Fcitx.Client.signals.update_formatted_preedit(client, preedit, cursor)
Signal Name:

update-formatted-preedit

Flags:

RUN_LAST

Parameters:

Emit when input method need to delete surrounding text

Property Details

Fcitx.Client.props.connection
Name:

connection

Type:

Fcitx.Connection

Default Value:

None

Flags:

WRITABLE, CONSTRUCT_ONLY

Fcitx Connection