# input.c File Reference

## Functions

MInputMethod * | mdebug_dump_im (MInputMethod *im, int indent)
| Dump an input method.
Functions
MInputMethod * | minput_open_im (MSymbol language, MSymbol name, void *arg)
| Open an input method.
void | minput_close_im (MInputMethod *im)
| Close an input method.
MInputContext * | minput_create_ic (MInputMethod *im, void *arg)
| Create an input context.
void | minput_destroy_ic (MInputContext *ic)
| Destroy an input context.
int | minput_filter (MInputContext *ic, MSymbol key, void *arg)
| Filter an input key.
int | minput_lookup (MInputContext *ic, MSymbol key, void *arg, MText *mt)
| Look up a text produced in the input context.
void | minput_set_spot (MInputContext *ic, int x, int y, int ascent, int descent, int fontsize, MText *mt, int pos)
| Set the spot of the input context.
void | minput_toggle (MInputContext *ic)
| Toggle input method.
void | minput_reset_ic (MInputContext *ic)
| Reset an input context.
MPlist * | minput_get_title_icon (MSymbol language, MSymbol name)
| Get title and icon filename of an input method.
MText * | minput_get_description (MSymbol language, MSymbol name)
| Get description text of an input method.
MPlist * | minput_get_command (MSymbol language, MSymbol name, MSymbol command)
| Get information about input method command(s).
int | minput_config_command (MSymbol language, MSymbol name, MSymbol command, MPlist *keyseqlist)
| Configure the key sequence of an input method command.
MPlist * | minput_get_variable (MSymbol language, MSymbol name, MSymbol variable)
| Get information about input method variable(s).
int | minput_config_variable (MSymbol language, MSymbol name, MSymbol variable, MPlist *value)
| Configure the value of an input method variable.
char * | minput_config_file ()
| Get the name of per-user customization file.
int | minput_save_config (void)
| Save configurations in per-user customization file.
Obsolete functions
MPlist * | minput_get_variables (MSymbol language, MSymbol name)
| Get a list of variables of an input method (obsolete).
int | minput_set_variable (MSymbol language, MSymbol name, MSymbol variable, void *value)
| Set the initial value of an input method variable.
MPlist * | minput_get_commands (MSymbol language, MSymbol name)
| Get information about input method commands.
int | minput_assign_command_keys (MSymbol language, MSymbol name, MSymbol command, MPlist *keyseq)
| Assign a key sequence to an input method command (obsolete).
int | minput_callback (MInputContext *ic, MSymbol command)
| Call a callback function.

## Variables

MSymbol | Minput_method
| Symbol whose name is "input-method".
MInputDriver | minput_default_driver
| The default driver for internal input methods.
MInputDriver * | minput_driver
| The driver for internal input methods.
MSymbol | Minput_driver
Variables: Predefined symbols for callback commands.

These are the predefined symbols that are used as the `COMMAND` argument of callback functions of an input method driver (see MInputDriver::callback_list).

Most of them do not require extra argument nor return any value; exceptions are these:

Minput_get_surrounding_text: When a callback function assigned for this command is called, the first element of MInputContext::plist has key Minteger and the value specifies which portion of the surrounding text should be retrieved. If the value is positive, it specifies the number of characters following the current cursor position. If the value is negative, the absolute value specifies the number of characters preceding the current cursor position. If the value is zero, it means that the caller just wants to know if the surrounding text is currently supported or not.

If the surrounding text is currently supported, the callback function must set the key of this element to Mtext and the value to the retrieved M-text. The length of the M-text may be shorter than the requested number of characters, if the available text is not that long. The length can be zero in the worst case. Or, the length may be longer if an application thinks it is more efficient to return that length.

If the surrounding text is not currently supported, the callback function should return without changing the first element of MInputContext::plist.

Minput_delete_surrounding_text: When a callback function assigned for this command is called, the first element of MInputContext::plist has key Minteger and the value specifies which portion of the surrounding text should be deleted in the same way as the case of Minput_get_surrounding_text. The callback function must delete the specified text. It should not alter MInputContext::plist.

MSymbol | Minput_preedit_start
MSymbol | Minput_preedit_done
MSymbol | Minput_preedit_draw
MSymbol | Minput_status_start
MSymbol | Minput_status_done
MSymbol | Minput_status_draw
MSymbol | Minput_candidates_start
MSymbol | Minput_candidates_done
MSymbol | Minput_candidates_draw
MSymbol | Minput_set_spot
MSymbol | Minput_toggle
MSymbol | Minput_reset
MSymbol | Minput_get_surrounding_text
MSymbol | Minput_delete_surrounding_text
Variables: Predefined symbols for special input events.
These are the predefined symbols that are used as the `KEY` argument of minput_filter().
MSymbol | Minput_focus_out
MSymbol | Minput_focus_in
MSymbol | Minput_focus_move
Variables: Predefined symbols used in input method information.
MSymbol | Minherited
MSymbol | Mcustomized
MSymbol | Mconfigured