# cmd_send_keys_inject_key

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-send-keys.c#L61
- **Page:** https://libtmux.org/en/tmux/latest/reference/c-function-cmd-send-keys-c-cmd_send_keys_inject_key/

```c
static struct cmdq_item * cmd_send_keys_inject_key(struct cmdq_item *item, struct cmdq_item *after, struct args *args, key_code key)
```

## Parameters

- `item` (`struct cmdq_item *`)
- `after` (`struct cmdq_item *`)
- `args` (`struct args *`)
- `key` (`key_code`)

## Called by

- [`cmd_send_keys_exec`](/en/tmux/latest/reference/c-function-cmd-send-keys-c-cmd_send_keys_exec/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-send-keys.c#L219)
- [`cmd_send_keys_inject_string`](/en/tmux/latest/reference/c-function-cmd-send-keys-c-cmd_send_keys_inject_string/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-send-keys.c#L120)

## Calls

- [`args_has`](/en/tmux/latest/reference/c-function-args_has/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-send-keys.c#L74)
- [`cmdq_get_target`](/en/tmux/latest/reference/c-function-cmdq_get_target/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-send-keys.c#L64)
- [`cmdq_get_target_client`](/en/tmux/latest/reference/c-function-cmdq_get_target_client/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-send-keys.c#L65)
- [`key_bindings_dispatch`](/en/tmux/latest/reference/c-function-key_bindings_dispatch/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-send-keys.c#L98)
- [`key_bindings_get_table`](/en/tmux/latest/reference/c-function-key_bindings_get_table/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-send-keys.c#L93)
- [`key_bindings_unref_table`](/en/tmux/latest/reference/c-function-key_bindings_unref_table/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-send-keys.c#L99)
- [`server_client_handle_key`](/en/tmux/latest/reference/c-function-server_client_handle_key/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-send-keys.c#L80)
- [`window_pane_key`](/en/tmux/latest/reference/c-function-window_pane_key/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-send-keys.c#L89)
- [`xcalloc`](/en/tmux/latest/reference/c-function-xcalloc/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/cmd-send-keys.c#L77)

## Other function references

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

## Referenced declarations

- [`args`](/en/tmux/latest/reference/c-struct-args/) (struct)
- [`key_event.buf`](/en/tmux/latest/reference/c-struct-key_event-buf/) (attribute)
- [`cmdq_item`](/en/tmux/latest/reference/c-struct-cmdq_item/) (struct)
- [`key_event.key`](/en/tmux/latest/reference/c-struct-key_event-key/) (attribute)
- [`key_code`](/en/tmux/latest/reference/c-typedef-key_code/) (typealias)
- [`window_mode.key_table`](/en/tmux/latest/reference/c-struct-window_mode-key_table/) (attribute)
- [`KEYC_MASK_FLAGS`](/en/tmux/latest/reference/c-define-tmux-h-keyc_mask_flags/) (constant)
- [`KEYC_SENT`](/en/tmux/latest/reference/c-define-tmux-h-keyc_sent/) (constant)
- [`key_event.m`](/en/tmux/latest/reference/c-struct-key_event-m/) (attribute)
- [`window_mode_entry.mode`](/en/tmux/latest/reference/c-struct-window_mode_entry-mode/) (attribute)
- [`window_pane.modes`](/en/tmux/latest/reference/c-struct-window_pane-modes/) (attribute)
- [`key_table.references`](/en/tmux/latest/reference/c-struct-key_table-references/) (attribute)
- [`cmd_find_state.s`](/en/tmux/latest/reference/c-struct-cmd_find_state-s/) (attribute)
- [`cmd_find_state.wl`](/en/tmux/latest/reference/c-struct-cmd_find_state-wl/) (attribute)
- [`cmd_find_state.wp`](/en/tmux/latest/reference/c-struct-cmd_find_state-wp/) (attribute)
