EekKey

## EekKey EekKey — Base class of a key |

## Synopsis

                        EekKey;
    struct              EekKeyClass;
    void                eek_key_get_index                   (EekKey *key,
                                                             gint *column,
                                                             gint *row);
    guint               eek_key_get_keycode                 (EekKey *key);
    guint               eek_key_get_oref                    (EekKey *key);
    EekSymbol *         eek_key_get_symbol                  (EekKey *key);
    EekSymbol *         eek_key_get_symbol_at_index         (EekKey *key,
                                                             gint group,
                                                             gint level,
                                                             gint fallback_group,
                                                             gint fallback_level);
    EekSymbolMatrix *   eek_key_get_symbol_matrix           (EekKey *key);
    EekSymbol *         eek_key_get_symbol_with_fallback    (EekKey *key,
                                                             gint fallback_group,
                                                             gint fallback_level);
    gboolean            eek_key_is_locked                   (EekKey *key);
    gboolean            eek_key_is_pressed                  (EekKey *key);
    void                eek_key_set_index                   (EekKey *key,
                                                             gint column,
                                                             gint row);
    void                eek_key_set_keycode                 (EekKey *key,
                                                             guint keycode);
    void                eek_key_set_oref                    (EekKey *key,
                                                             guint oref);
    void                eek_key_set_symbol_matrix           (EekKey *key,
                                                             EekSymbolMatrix *matrix);

## Object Hierarchy

      GObject
       +----EekElement
             +----EekKey

## Properties

      "column"                   gint                  : Read / Write
      "keycode"                  guint                 : Read / Write
      "oref"                     gulong                : Read / Write
      "row"                      gint                  : Read / Write
      "symbol-matrix"            EekSymbolMatrix*      : Read / Write

## Signals

      "cancelled"                                      : Run Last
      "locked"                                         : Run First
      "pressed"                                        : Run First
      "released"                                       : Run Last
      "unlocked"                                       : Run Last

## Description

The EekKeyClass class represents a key.

## Details

### EekKey

    typedef struct _EekKey EekKey;

The EekKey structure contains only private data and should only be accessed using the provided API.

### struct EekKeyClass

    struct EekKeyClass {
        /* signals */
        void (* pressed)   (EekKey *key);
        void (* released)  (EekKey *key);
        void (* locked)    (EekKey *key);
        void (* unlocked)  (EekKey *key);
        void (* cancelled) (EekKey *key);
    };

`pressed` () | class handler for "pressed" signal
`released` () | class handler for "released" signal
`locked` () | class handler for "locked" signal
`unlocked` () | class handler for "unlocked" signal
`cancelled` () | class handler for "cancelled" signal

### eek_key_get_index ()

    void                eek_key_get_index                   (EekKey *key,
                                                             gint *column,
                                                             gint *row);

Get the location of `key` in EekSection.

`key` : | an EekKey
`column` : | pointer where the column index of `key` in EekSection will be stored. [allow-none]
`row` : | pointer where the row index of `key` in EekSection will be stored. [allow-none]

### eek_key_get_keycode ()

    guint               eek_key_get_keycode                 (EekKey *key);

Get keycode of `key`.

`key` : | an EekKey
Returns : | keycode or `EEK_INVALID_KEYCODE` on failure

### eek_key_get_oref ()

    guint               eek_key_get_oref                    (EekKey *key);

Get the outline id of `key`.

`key` : | an EekKey
Returns : | unsigned integer

### eek_key_get_symbol ()

    EekSymbol *         eek_key_get_symbol                  (EekKey *key);

Get the current symbol of `key`.

`key` : | an EekKey
Returns : | the current EekSymbol or `NULL` on failure. [transfer none]

### eek_key_get_symbol_at_index ()

    EekSymbol *         eek_key_get_symbol_at_index         (EekKey *key,
                                                             gint group,
                                                             gint level,
                                                             gint fallback_group,
                                                             gint fallback_level);

Get the symbol at (`group`, `level`) in the symbol matrix of `key`.

`key` : | an EekKey
`group` : | group index of the symbol matrix
`level` : | level index of the symbol matrix
`fallback_group` : | fallback group index
`fallback_level` : | fallback level index
Returns : | an EekSymbol at (`group`, `level`), or `NULL`. [transfer none]

### eek_key_get_symbol_matrix ()

    EekSymbolMatrix *   eek_key_get_symbol_matrix           (EekKey *key);

Get the symbol matrix of `key`.

`key` : | an EekKey
Returns : | EekSymbolMatrix or `NULL`. [transfer none]

### eek_key_get_symbol_with_fallback ()

    EekSymbol *         eek_key_get_symbol_with_fallback    (EekKey *key,
                                                             gint fallback_group,
                                                             gint fallback_level);

Get the current symbol of `key`.

`key` : | an EekKey
`fallback_group` : | fallback group index
`fallback_level` : | fallback level index
Returns : | the current EekSymbol or `NULL` on failure. [transfer none]

### eek_key_is_locked ()

    gboolean            eek_key_is_locked                   (EekKey *key);

Return `TRUE` if key is marked as locked.

`key` : | an EekKey

### eek_key_is_pressed ()

    gboolean            eek_key_is_pressed                  (EekKey *key);

Return `TRUE` if key is marked as pressed.

`key` : | an EekKey

### eek_key_set_index ()

    void                eek_key_set_index                   (EekKey *key,
                                                             gint column,
                                                             gint row);

Set the location of `key` in EekSection with `column` and `row`.

`key` : | an EekKey
`column` : | column index of `key` in EekSection
`row` : | row index of `key` in EekSection

### eek_key_set_keycode ()

    void                eek_key_set_keycode                 (EekKey *key,
                                                             guint keycode);

Set the keycode of `key` to `keycode`. Since typically the keycode value is used to find a key in a keyboard by calling eek_keyboard_find_key_by_keycode, it is not necessarily the same as the X keycode but it should be unique in the keyboard `key` belongs to.

`key` : | an EekKey
`keycode` : | keycode

### eek_key_set_oref ()

    void                eek_key_set_oref                    (EekKey *key,
                                                             guint oref);

Set the outline id of `key` to `oref`.

`key` : | an EekKey
`oref` : | outline id of `key`

### eek_key_set_symbol_matrix ()

    void                eek_key_set_symbol_matrix           (EekKey *key,
                                                             EekSymbolMatrix *matrix);

Set the symbol matrix of `key` to `matrix`.

`key` : | an EekKey
`matrix` : | an EekSymbolMatrix

## Property Details

### The `"column"` property

      "column"                   gint                  : Read / Write

The column index of EekKey in the parent EekSection.

Allowed values: >= G_MAXULONG

Default value: -1

### The `"keycode"` property

      "keycode"                  guint                 : Read / Write

The keycode of EekKey.

Default value: 0

### The `"oref"` property

      "oref"                     gulong                : Read / Write

The outline id of EekKey.

### The `"row"` property

      "row"                      gint                  : Read / Write

The row index of EekKey in the parent EekSection.

Allowed values: >= G_MAXULONG

Default value: -1

### The `"symbol-matrix"` property

      "symbol-matrix"            EekSymbolMatrix*      : Read / Write

The symbol matrix of EekKey.

## Signal Details

### The `"cancelled"` signal

    void                user_function                      (EekKey  *key,
                                                            gpointer user_data)      : Run Last

The ::cancelled signal is emitted each time `key` is shifted to the cancelled state.

`key` : | an EekKey
`user_data` : | user data set when the signal handler was connected.

### The `"locked"` signal

    void                user_function                      (EekKey  *key,
                                                            gpointer user_data)      : Run First

The ::locked signal is emitted each time `key` is shifted to the locked state. The class handler runs before signal handlers to allow signal handlers to read the status of `key` with `eek_key_is_locked()`.

`key` : | an EekKey
`user_data` : | user data set when the signal handler was connected.

### The `"pressed"` signal

    void                user_function                      (EekKey  *key,
                                                            gpointer user_data)      : Run First

The ::pressed signal is emitted each time `key` is shifted to the pressed state. The class handler runs before signal handlers to allow signal handlers to read the status of `key` with `eek_key_is_pressed()`.

`key` : | an EekKey
`user_data` : | user data set when the signal handler was connected.

### The `"released"` signal

    void                user_function                      (EekKey  *key,
                                                            gpointer user_data)      : Run Last

The ::released signal is emitted each time `key` is shifted to the released state.

`key` : | an EekKey
`user_data` : | user data set when the signal handler was connected.

### The `"unlocked"` signal

    void                user_function                      (EekKey  *key,
                                                            gpointer user_data)      : Run Last

The ::unlocked signal is emitted each time `key` is shifted to the unlocked state.

`key` : | an EekKey
`user_data` : | user data set when the signal handler was connected.