EekKeyboard

## EekKeyboard EekKeyboard — Base class of a keyboard |

## Synopsis

                        EekKeyboard;
    struct              EekKeyboardClass;
                        EekModifierKey;
    guint               eek_keyboard_add_outline            (EekKeyboard *keyboard,
                                                             EekOutline *outline);
    EekSection *        eek_keyboard_create_section         (EekKeyboard *keyboard);
    EekKey *            eek_keyboard_find_key_by_keycode    (EekKeyboard *keyboard,
                                                             guint keycode);
    EekModifierType     eek_keyboard_get_alt_gr_mask        (EekKeyboard *keyboard);
    EekLayout *         eek_keyboard_get_layout             (EekKeyboard *keyboard);
    GList *             eek_keyboard_get_locked_keys        (EekKeyboard *keyboard);
    EekModifierBehavior eek_keyboard_get_modifier_behavior  (EekKeyboard *keyboard);
    EekModifierType     eek_keyboard_get_modifiers          (EekKeyboard *keyboard);
    EekModifierType     eek_keyboard_get_num_lock_mask      (EekKeyboard *keyboard);
    EekOutline *        eek_keyboard_get_outline            (EekKeyboard *keyboard,
                                                             guint oref);
    GList *             eek_keyboard_get_pressed_keys       (EekKeyboard *keyboard);
    void                eek_keyboard_get_size               (EekKeyboard *keyboard,
                                                             gdouble *width,
                                                             gdouble *height);
    EekKeyboard *       eek_keyboard_new                    (EekLayout *layout,
                                                             gdouble initial_width,
                                                             gdouble initial_height);
    void                eek_keyboard_set_alt_gr_mask        (EekKeyboard *keyboard,
                                                             EekModifierType alt_gr_mask);
    void                eek_keyboard_set_modifier_behavior  (EekKeyboard *keyboard,
                                                             EekModifierBehavior modifier_behavior);
    void                eek_keyboard_set_modifiers          (EekKeyboard *keyboard,
                                                             EekModifierType modifiers);
    void                eek_keyboard_set_num_lock_mask      (EekKeyboard *keyboard,
                                                             EekModifierType num_lock_mask);
    void                eek_keyboard_set_size               (EekKeyboard *keyboard,
                                                             gdouble width,
                                                             gdouble height);

## Object Hierarchy

      GObject
       +----EekElement
             +----EekContainer
                   +----EekKeyboard

## Properties

      "layout"                   EekLayout*            : Read / Write / Construct Only
      "modifier-behavior"        EekModifierBehavior   : Read / Write

## Signals

      "key-cancelled"                                  : Run Last
      "key-locked"                                     : Run Last
      "key-pressed"                                    : Run Last
      "key-released"                                   : Run Last
      "key-unlocked"                                   : Run Last

## Description

The EekKeyboardClass class represents a keyboard, which consists of one or more sections of the EekSectionClass class.

## Details

### EekKeyboard

    typedef struct _EekKeyboard EekKeyboard;

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

### struct EekKeyboardClass

    struct EekKeyboardClass {
        EekSection *(* create_section)      (EekKeyboard *self);

        EekKey     *(* find_key_by_keycode) (EekKeyboard *self,
                                             guint        keycode);

        /* signals */
        void        (* key_pressed)         (EekKeyboard *self,
                                             EekKey      *key);
        void        (* key_released)        (EekKeyboard *self,
                                             EekKey      *key);

        /* signals */
        void        (* key_locked)          (EekKeyboard *self,
                                             EekKey      *key);
        void        (* key_unlocked)        (EekKeyboard *self,
                                             EekKey      *key);
        void        (* key_cancelled)        (EekKeyboard *self,
                                             EekKey      *key);
    };

`create_section` () | virtual function for creating a section
`find_key_by_keycode` () | virtual function for finding a key in the keyboard by keycode
`key_pressed` () | class handler for "key-pressed" signal
`key_released` () | class handler for "key-released" signal
`key_locked` () | class handler for "key-locked" signal
`key_unlocked` () | class handler for "key-unlocked" signal
`key_cancelled` () | class handler for "key-cancelled" signal

### EekModifierKey

    typedef struct {
        EekModifierType modifiers;
        EekKey *key;
    } EekModifierKey;

Entry which associates modifier mask to a key. This is returned by `eek_keyboard_get_locked_keys()`.

EekModifierType `modifiers`; | an EekModifierType which `key` triggers
EekKey *`key`; | an EekKey

### eek_keyboard_add_outline ()

    guint               eek_keyboard_add_outline            (EekKeyboard *keyboard,
                                                             EekOutline *outline);

Register an outline of `keyboard`.

`keyboard` : | an EekKeyboard
`outline` : | an EekOutline
Returns : | an unsigned integer ID of the registered outline, for later reference

### eek_keyboard_create_section ()

    EekSection *        eek_keyboard_create_section         (EekKeyboard *keyboard);

Create an EekSection instance and append it to `keyboard`. This function is rarely called by application but called by EekLayout implementation.

`keyboard` : | an EekKeyboard

### eek_keyboard_find_key_by_keycode ()

    EekKey *            eek_keyboard_find_key_by_keycode    (EekKeyboard *keyboard,
                                                             guint keycode);

Find an EekKey whose keycode is `keycode`.

`keyboard` : | an EekKeyboard
`keycode` : | a keycode
Returns : | EekKey whose keycode is `keycode`. [transfer none]

### eek_keyboard_get_alt_gr_mask ()

    EekModifierType     eek_keyboard_get_alt_gr_mask        (EekKeyboard *keyboard);

Get modifier mask used as Alt_Gr.

`keyboard` : | an EekKeyboard
Returns : | an EekModifierType

### eek_keyboard_get_layout ()

    EekLayout *         eek_keyboard_get_layout             (EekKeyboard *keyboard);

Get the layout used to create `keyboard`.

`keyboard` : | an EekKeyboard
Returns : | an EekLayout

### eek_keyboard_get_locked_keys ()

    GList *             eek_keyboard_get_locked_keys        (EekKeyboard *keyboard);

Get locked keys.

`keyboard` : | an EekKeyboard
Returns : | A list of locked keys. [transfer container][element-type Eek.ModifierKey]

### eek_keyboard_get_modifier_behavior ()

    EekModifierBehavior eek_keyboard_get_modifier_behavior  (EekKeyboard *keyboard);

Get the modifier handling mode of `keyboard`.

`keyboard` : | an EekKeyboard
Returns : | EekModifierBehavior

### eek_keyboard_get_modifiers ()

    EekModifierType     eek_keyboard_get_modifiers          (EekKeyboard *keyboard);

Get the current modifier status of `keyboard`.

`keyboard` : | an EekKeyboard
Returns : | EekModifierType

### eek_keyboard_get_num_lock_mask ()

    EekModifierType     eek_keyboard_get_num_lock_mask      (EekKeyboard *keyboard);

Get modifier mask used as Num_Lock.

`keyboard` : | an EekKeyboard
Returns : | an EekModifierType

### eek_keyboard_get_outline ()

    EekOutline *        eek_keyboard_get_outline            (EekKeyboard *keyboard,
                                                             guint oref);

Get an outline associated with `oref` in `keyboard`.

`keyboard` : | an EekKeyboard
`oref` : | ID of the outline
Returns : | an EekOutline, which should not be released

### eek_keyboard_get_pressed_keys ()

    GList *             eek_keyboard_get_pressed_keys       (EekKeyboard *keyboard);

Get pressed keys.

`keyboard` : | an EekKeyboard
Returns : | A list of pressed keys. [transfer container][element-type EekKey]

### eek_keyboard_get_size ()

    void                eek_keyboard_get_size               (EekKeyboard *keyboard,
                                                             gdouble *width,
                                                             gdouble *height);

Get the size of `keyboard`.

`keyboard` : | an EekKeyboard
`width` : | width of `keyboard`
`height` : | height of `keyboard`

### eek_keyboard_new ()

    EekKeyboard *       eek_keyboard_new                    (EekLayout *layout,
                                                             gdouble initial_width,
                                                             gdouble initial_height);

Create a new EekKeyboard based on `layout`.

`layout` : | an EekLayout
`initial_width` : | initial width of the keyboard
`initial_height` : | initial height of the keyboard

### eek_keyboard_set_alt_gr_mask ()

    void                eek_keyboard_set_alt_gr_mask        (EekKeyboard *keyboard,
                                                             EekModifierType alt_gr_mask);

Set modifier mask used as Alt_Gr.

`keyboard` : | an EekKeyboard
`alt_gr_mask` : | an EekModifierType

### eek_keyboard_set_modifier_behavior ()

    void                eek_keyboard_set_modifier_behavior  (EekKeyboard *keyboard,
                                                             EekModifierBehavior modifier_behavior);

Set the modifier handling mode of `keyboard`.

`keyboard` : | an EekKeyboard
`modifier_behavior` : | modifier behavior of `keyboard`

### eek_keyboard_set_modifiers ()

    void                eek_keyboard_set_modifiers          (EekKeyboard *keyboard,
                                                             EekModifierType modifiers);

### eek_keyboard_set_num_lock_mask ()

    void                eek_keyboard_set_num_lock_mask      (EekKeyboard *keyboard,
                                                             EekModifierType num_lock_mask);

Set modifier mask used as Num_Lock.

`keyboard` : | an EekKeyboard
`num_lock_mask` : | an EekModifierType

### eek_keyboard_set_size ()

    void                eek_keyboard_set_size               (EekKeyboard *keyboard,
                                                             gdouble width,
                                                             gdouble height);

## Property Details

### The `"layout"` property

      "layout"                   EekLayout*            : Read / Write / Construct Only

The layout used to create this EekKeyboard.

### The `"modifier-behavior"` property

      "modifier-behavior"        EekModifierBehavior   : Read / Write

The modifier handling mode of EekKeyboard.

Default value: EEK_MODIFIER_BEHAVIOR_NONE

## Signal Details

### The `"key-cancelled"` signal

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

The ::key-cancelled signal is emitted each time a key in `keyboard` is shifted to the cancelled state.

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

### The `"key-locked"` signal

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

The ::key-locked signal is emitted each time a key in `keyboard` is shifted to the locked state.

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

### The `"key-pressed"` signal

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

The ::key-pressed signal is emitted each time a key in `keyboard` is shifted to the pressed state.

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

### The `"key-released"` signal

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

The ::key-released signal is emitted each time a key in `keyboard` is shifted to the released state.

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

### The `"key-unlocked"` signal

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

The ::key-unlocked signal is emitted each time a key in `keyboard` is shifted to the unlocked state.

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

## See Also

EekSection