Meta.Display.add_keybinding

### Method

# Meta Displayadd_keybinding

#### Declaration [src]

    guint
    meta_display_add_keybinding (
      MetaDisplay* display,
      const char* name,
      GSettings* settings,
      MetaKeyBindingFlags flags,
      MetaKeyHandlerFunc handler,
      gpointer user_data,
      GDestroyNotify free_data
    )

#### Description [src]

Add a keybinding at runtime. The key `name` in `schema` needs to be of type `G_VARIANT_TYPE_STRING_ARRAY`, with each string describing a keybinding in the form of “<Control>a” or “<Shift><Alt>F1”. The parser is fairly liberal and allows lower or upper case, and also abbreviations such as “<Ctl>” and “<Ctrl>”. If the key is set to the empty list or a list with a single element of either “” or “disabled”, the keybinding is disabled.

Use `meta_display_remove_keybinding()` to remove the binding.

#### Parameters

`name` | `const char*`
| The binding’s name.
| The data is owned by the caller of the function.
| The value is a NUL terminated UTF-8 string.
`settings` | `GSettings`
| The `GSettings` object where `name` is stored.
| The data is owned by the caller of the function.
`flags` | `MetaKeyBindingFlags`
| Flags to specify binding details.
`handler` | `MetaKeyHandlerFunc`
| Function to run when the keybinding is invoked.
`user_data` | `gpointer`
| The data to pass to `handler`.
| The argument can be `NULL`.
| The data is owned by the caller of the function.
`free_data` | `GDestroyNotify`
| Function to free `user_data`.

#### Return value

Returns: | `guint`
| The corresponding keybinding action if the keybinding was added successfully, otherwise `META_KEYBINDING_ACTION_NONE`.