process_key_event_async


Description:

public async void process_key_event_async (uint32 keyval, uint32 keycode, uint32 state, int timeout_msec, Cancellable? cancellable)

Pass the key event to input method engine.

Key symbols are characters/symbols produced by key press, for example, pressing "s" generates key symbol "s"; pressing shift-"s" generates key symbol "S". Same key on keyboard may produce different key symbols on different keyboard layout. e.g., "s" key on QWERTY keyboard produces "o" in DVORAK layout.

Unlike key symbol, keycode is only determined by the location of the key, and irrelevant of the keyboard layout.

Briefly speaking, input methods that expect certain keyboard layout should use keycode; otherwise keyval is sufficient. For example, Chewing, Cangjie, Wubi expect an en-US QWERTY keyboard, these should use keycode; while pinyin can rely on keyval only, as it is less sensitive to the keyboard layout change, DVORAK users can still use DVORAK layout to input pinyin.

Use lookup_keysym to convert keycode to keysym in given keyboard layout.

see_also: process_key_event

Parameters:

this

An IBusInputContext.

keyval

Key symbol of a key event.

keycode

Keycode of a key event.

state

Key modifier flags.

timeout_msec

The timeout in milliseconds or -1 to use the default timeout.

cancellable

A GCancellable or NULL.

callback

A GAsyncReadyCallback to call when the request is satisfied or NULL if you don't care about the result of the method invocation.

user_data

The data to pass to callback.