# key_bindings_add

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/key-bindings.c#L191
- **Page:** https://libtmux.org/en/tmux/latest/reference/c-function-key_bindings_add/

```c
void key_bindings_add(const char *name, key_code key, const char *note, int repeat, struct cmd_list *cmdlist)
```

## Parameters

- `name` (`const char *`)
- `key` (`key_code`)
- `note` (`const char *`)
- `repeat` (`int`)
- `cmdlist` (`struct cmd_list *`)

## Called by

- [`cmd_bind_key_exec`](/en/tmux/latest/reference/c-function-cmd-bind-key-c-cmd_bind_key_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-bind-key.c#L80)

## Calls

- [`cmd_list_print`](/en/tmux/latest/reference/c-function-cmd_list_print/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/key-bindings.c#L228)
- [`key_bindings_free`](/en/tmux/latest/reference/c-function-key-bindings-c-key_bindings_free/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/key-bindings.c#L214)
- [`key_bindings_get_table`](/en/tmux/latest/reference/c-function-key_bindings_get_table/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/key-bindings.c#L198)
- [`log_debug`](/en/tmux/latest/reference/c-function-log_debug/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/key-bindings.c#L229)
- [`xcalloc`](/en/tmux/latest/reference/c-function-xcalloc/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/key-bindings.c#L217)
- [`xstrdup`](/en/tmux/latest/reference/c-function-xstrdup/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/key-bindings.c#L205)

## Other function references

- [`key_bindings_get`](/en/tmux/latest/reference/c-function-key_bindings_get/) (function)
- [`key_string_lookup_key`](/en/tmux/latest/reference/c-function-key_string_lookup_key/) (function)

## Referenced declarations

- [`cmd_list`](/en/tmux/latest/reference/c-struct-cmd_list/) (struct)
- [`key_binding.cmdlist`](/en/tmux/latest/reference/c-struct-key_binding-cmdlist/) (attribute)
- [`key_binding.flags`](/en/tmux/latest/reference/c-struct-key_binding-flags/) (attribute)
- [`key_binding.key`](/en/tmux/latest/reference/c-struct-key_binding-key/) (attribute)
- [`KEY_BINDING_REPEAT`](/en/tmux/latest/reference/c-define-tmux-h-key_binding_repeat/) (constant)
- [`key_table.key_bindings`](/en/tmux/latest/reference/c-struct-key_table-key_bindings/) (attribute)
- [`key_code`](/en/tmux/latest/reference/c-typedef-key_code/) (typealias)
- [`KEYC_MASK_FLAGS`](/en/tmux/latest/reference/c-define-tmux-h-keyc_mask_flags/) (constant)
- [`key_table.name`](/en/tmux/latest/reference/c-struct-key_table-name/) (attribute)
- [`key_binding.note`](/en/tmux/latest/reference/c-struct-key_binding-note/) (attribute)
- [`key_binding.tablename`](/en/tmux/latest/reference/c-struct-key_binding-tablename/) (attribute)
