NAME

XmbLookupString, XwcLookupString, Xutf8LookupString - obtain composed input from an input method

SYNTAX

int XmbLookupString(XIC _i_c, XKeyPressedEvent *_e_v_e_n_t, char *_b_u_f_f_e_r___r_e_t_u_r_n, int _b_y_t_e_s___b_u_f_f_e_r, KeySym *_k_e_y_s_y_m___r_e_t_u_r_n, Status *_s_t_a_t_u_s___r_e_t_u_r_n); int XwcLookupString(XIC _i_c, XKeyPressedEvent *_e_v_e_n_t, wchar_t *_b_u_f_f_e_r___r_e_t_u_r_n, int _w_c_h_a_r_s___b_u_f_f_e_r, KeySym *_k_e_y_s_y_m___r_e_t_u_r_n, Status *_s_t_a_t_u_s___r_e_t_u_r_n); int Xutf8LookupString(XIC _i_c, XKeyPressedEvent *_e_v_e_n_t, char *_b_u_f_f_e_r___r_e_t_u_r_n, int _b_y_t_e_s___b_u_f_f_e_r, KeySym *_k_e_y_s_y_m___r_e_t_u_r_n, Status *_s_t_a_t_u_s___r_e_t_u_r_n);

ARGUMENTS

_b_u_f_f_e_r___r_e_t_u_r_n Returns a multibyte string or wide character string (if any)
from the input method.
_b_y_t_e_s___b_u_f_f_e_r
_w_c_h_a_r_s___b_u_f_f_e_r Specifies space available in the return buffer.
_e_v_e_n_t Specifies the key event to be used.
_i_c Specifies the input context.
_k_e_y_s_y_m___r_e_t_u_r_n Returns the KeySym computed from the event if this argument is not NULL.
_s_t_a_t_u_s___r_e_t_u_r_n Returns a value indicating what kind of data is returned.

DESCRIPTION

The _X_m_b_L_o_o_k_u_p_S_t_r_i_n_g, _X_w_c_L_o_o_k_u_p_S_t_r_i_n_g and _X_u_t_f_8_L_o_o_k_u_p_S_t_r_i_n_g functions return the string from the input method specified in the buffer_return argument. If no string is returned, the buffer_return argument is unchanged.

The KeySym into which the KeyCode from the event was mapped is returned in the keysym_return argument if it is non-NULL and the status_return argument indicates that a KeySym was returned. If both a string and a KeySym are returned, the KeySym value does not necessarily correspond to the string returned.

_X_m_b_L_o_o_k_u_p_S_t_r_i_n_g and _X_u_t_f_8_L_o_o_k_u_p_S_t_r_i_n_g return the length of the string in bytes, and _X_w_c_L_o_o_k_u_p_S_t_r_i_n_g returns the length of the string in characters. Both _X_m_b_L_o_o_k_u_p_S_t_r_i_n_g and _X_w_c_L_o_o_k_u_p_S_t_r_i_n_g return text in the encoding of the locale bound to the input method of the specified input context, and _X_u_t_f_8_L_o_o_k_u_p_S_t_r_i_n_g returns text in UTF-8 encoding.

Each string returned by _X_m_b_L_o_o_k_u_p_S_t_r_i_n_g and _X_w_c_L_o_o_k_u_p_S_t_r_i_n_g begins in the initial state of the encoding of the locale (if the encoding of the locale is state-dependent).

Note

To ensure proper input processing, it is essential that the client pass only _K_e_y_P_r_e_s_s events to _X_m_b_L_o_o_k_u_p_S_t_r_i_n_g, _X_w_c_L_o_o_k_u_p_S_t_r_i_n_g and _X_u_t_f_8_L_o_o_k_u_p_S_t_r_i_n_g. Their behavior when a client passes a _K_e_y_R_e_l_e_a_s_e event is undefined.

Clients should check the status_return argument before using the other returned values. These three functions each return a value to status_return that indicates what has been returned in the other arguments. The possible values returned are:

lw(1.5i) lw(4.3i).
T{
_X_B_u_f_f_e_r_O_v_e_r_f_l_o_w
T}      T{
The input string to be returned is too large for the supplied buffer_return.
The required size (for
_X_m_b_L_o_o_k_u_p_S_t_r_i_n_g,
_X_u_t_f_8_L_o_o_k_u_p_S_t_r_i_n_g
in bytes; for
_X_w_c_L_o_o_k_u_p_S_t_r_i_n_g
in characters) is returned as the value of the function,
and the contents of buffer_return and keysym_return are not modified.
The client should recall the function with the same event
and a buffer of adequate size to obtain the string.
T}
T{
_X_L_o_o_k_u_p_N_o_n_e
T}      T{
No consistent input has been composed so far.
The contents of buffer_return and keysym_return are not modified,
and the function returns zero.
T}
T{
_X_L_o_o_k_u_p_C_h_a_r_s
T}      T{
Some input characters have been composed.
They are placed in the buffer_return argument, using the encoding
described above,
and the string length is returned as the value of the function.
The content of the keysym_return argument is not modified.
T}
T{
_X_L_o_o_k_u_p_K_e_y_S_y_m
T}      T{
A KeySym has been returned instead of a string
and is returned in keysym_return.
The content of the buffer_return argument is not modified,
and the function returns zero.
T}
T{
_X_L_o_o_k_u_p_B_o_t_h
T}      T{
Both a KeySym and a string are returned;
_X_L_o_o_k_u_p_C_h_a_r_s
and
_X_L_o_o_k_u_p_K_e_y_S_y_m
occur simultaneously.
T}

It does not make any difference if the input context passed as an argument to _X_m_b_L_o_o_k_u_p_S_t_r_i_n_g, _X_w_c_L_o_o_k_u_p_S_t_r_i_n_g and _X_u_t_f_8_L_o_o_k_u_p_S_t_r_i_n_g is the one currently in possession of the focus or not. Input may have been composed within an input context before it lost the focus, and that input may be returned on subsequent calls to _X_m_b_L_o_o_k_u_p_S_t_r_i_n_g, _X_w_c_L_o_o_k_u_p_S_t_r_i_n_g or _X_u_t_f_8_L_o_o_k_u_p_S_t_r_i_n_g even though it does not have any more keyboard focus.

The function _X_u_t_f_8_L_o_o_k_u_p_S_t_r_i_n_g is an XFree86 extension introduced in XFree86 4.0.2. Its presence is indicated by the macro _X___H_A_V_E___U_T_F_8___S_T_R_I_N_G.

SEE ALSO

XLookupKeysym(3X11)
_X_l_i_b _- _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e