Keyboard aliasRequest

From TrillWiki

Jump to: navigation, search

When a registered keyboard alias is entered in by the user, this notification will be generated.

Compatibility: 1.0 and higher

Contents

Syntax

callback(int window_id, char *icontrol, "keyboard_aliasRequest", keyboard_alias_request_t* data, void *userData);

Note that all Trillian functions and notifications begin with a lower-case letter, despite the Wiki requirement that all pages start with a capital letter.

Parameters

Keyboard aliasRequest utilitizes the keyboard_alias_request_t structure.

struct keyboard_alias_request_t
{
    unsigned int                struct_size;

    int                         alias_id;

    int                         alt;
    int                         ctrl;
    int                         shift;

    char                        key;

    char                        *text; //to be inserted...if none, make this NULL

    /* 2.0
     */
    char                        *medium;
    int                          connection_id;
    int                          window_id;
};



alias_id
The alias ID returned when the alias was registered.
alt
The same as when it was registered.
ctrl
The same as when it was registered.
shift
The same as when it was registered.
key
The same as when it was registered.
text
If the plugin wants to insert text, it should put the string here, otherwise leave this as NULL.


Return Value

Must return 0.

Remarks

If text is provided, be sure not to unallocate the memory for it until you receive a keyboard_aliasFree notification.

Also, after 2.0, creating events and allowing users to map them to a hotkey may be preferable behavior.


See also: keyboard_aliasFree