gandi_keymap(3) - Linux man page

Name

Here you will find some information on keymaps.

Synopsis

#include <gandi_core.h>

GANDIT_keymap ***GANDI_cpy_keymap(GANDIT_keymap ***d, GANDIT_keymap ***s);

int GANDI_get_keymap(GANDIT_keymap ***m, int k);

int GANDI_keymap_init();

GANDIT_keymap **GANDI_set_keymap(GANDIT_keymap ***m, int key, int val);

Description

There is a special widget capability. It is realised with two properties: keymap and keymap_sys (see gandi_gandiw(3gandi)). At the current state GANDI has no widgets which use keymap. Therefore it will be NULL if you do not change it intensionally.

There are a few (three are implemented as of now) routines for working with keymaps (with everything of GANDIT_keymap ** type). Keymap is a set of keys and its corresponging values. Each key from keymap has its own value.

The first argument of these routines (except GANDI_keymap_init) is a pointer to the keymap. Keymap has the type GANDIT_keymap **, where the following structure is used:

typedef struct _GANDIT_keymap {
        int key;
        int value;
} GANDIT_keymap;
If keymap is set, then pre_driver (see gandi_acts(3gandi)) will be called with a key's value. This is true for driver and post_driver as well. If keymap is NULL, then the drivers will recive the key directly.

keymap_sys is used by GANDI_action_driver (see gandi_driver (3gandi)).

GANDIT_keymap ***GANDI_cpy_keymap(GANDIT_keymap ***d, GANDIT_keymap ***s);

Clears *d and makes it a duplicate of *s. They will be two perfectly independent keymaps.

The return value is d if all goes right and NULL otherwise. In the last case *d will be NULL too and will NOT point to any allocated memory!

int GANDI_get_keymap(GANDIT_keymap ***m, int k);

Returns a value associated with the k key. There is a special 0th key. If it is present in the keymap and the k key was not found, the value of the 0th key will be returned. If keymap contains several 0th keys, the last one will be used.

int GANDI_keymap_init();

Force GANDI_keymap_sys_stencil to the initial state. GANDI_init() (see gandi_init(3gandi)) executes this. Return value is OK or ERR.

GANDI_keymap_sys_stencil is a keymap and set to every new widget as the keymap_sys. You may change it if you want another system keys.

GANDIT_keymap **GANDI_set_keymaGANDIT_keymap ***m, int key, int val);

Adds key with value val to the keymap or modifies its current value if it is present already. It is permitted that *m (but never m) is NULL.

On success *m will be changed and returned. Otherwise NULL will be returned in wich case *m either will not be changed at all or it probably will be a cleared list (see gandi_list(3gandi)) if it was NULL.

Notes

These routines are not well tested.

See Also

gandi_core(3gandi) gandi_gandiw(3gandi) gandi_init(3gandi) gandi_list(3gandi)