# mode_tree_key

- **Language:** C
- **Kind:** function
- **Source:** https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L1218
- **Page:** https://libtmux.org/en/tmux/latest/reference/c-function-mode_tree_key/

```c
int mode_tree_key(struct mode_tree_data *mtd, struct client *c, key_code *key, struct mouse_event *m, u_int *xp, u_int *yp)
```

## Parameters

- `mtd` (`struct mode_tree_data *`)
- `c` (`struct client *`)
- `key` (`key_code *`)
- `m` (`struct mouse_event *`)
- `xp` (`u_int *`)
- `yp` (`u_int *`)

## Called by

- [`window_buffer_key`](/en/tmux/latest/reference/c-function-window-buffer-c-window_buffer_key/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-buffer.c#L550)
- [`window_client_key`](/en/tmux/latest/reference/c-function-window-client-c-window_client_key/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-client.c#L367)
- [`window_customize_key`](/en/tmux/latest/reference/c-function-window-customize-c-window_customize_key/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-customize.c#L1439)
- [`window_tree_key`](/en/tmux/latest/reference/c-function-window-tree-c-window_tree_key/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/window-tree.c#L1248)

## Calls

- [`cmd_mouse_at`](/en/tmux/latest/reference/c-function-cmd_mouse_at/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L1232)
- [`mode_tree_build`](/en/tmux/latest/reference/c-function-mode_tree_build/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L1384)
- [`mode_tree_check_selected`](/en/tmux/latest/reference/c-function-mode-tree-c-mode_tree_check_selected/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L1460)
- [`mode_tree_clear_tagged`](/en/tmux/latest/reference/c-function-mode-tree-c-mode_tree_clear_tagged/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L1360)
- [`mode_tree_display_help`](/en/tmux/latest/reference/c-function-mode-tree-c-mode_tree_display_help/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L1296)
- [`mode_tree_display_menu`](/en/tmux/latest/reference/c-function-mode-tree-c-mode_tree_display_menu/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L1243)
- [`mode_tree_down`](/en/tmux/latest/reference/c-function-mode_tree_down/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L1308)
- [`mode_tree_search_set`](/en/tmux/latest/reference/c-function-mode-tree-c-mode_tree_search_set/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L1434)
- [`mode_tree_swap`](/en/tmux/latest/reference/c-function-mode-tree-c-mode_tree_swap/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L1312)
- [`mode_tree_up`](/en/tmux/latest/reference/c-function-mode_tree_up/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L1302)
- [`sort_next_order`](/en/tmux/latest/reference/c-function-sort_next_order/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L1383)
- [`status_prompt_set`](/en/tmux/latest/reference/c-function-status_prompt_set/) (function) [Call site](https://github.com/tmux/tmux/blob/e476c1230b958df0cb12977517d24b3dc931375b/mode-tree.c#L1428)

## Other function references

- [`mode_tree_filter_callback`](/en/tmux/latest/reference/c-function-mode-tree-c-mode_tree_filter_callback/) (function)
- [`mode_tree_filter_free`](/en/tmux/latest/reference/c-function-mode-tree-c-mode_tree_filter_free/) (function)
- [`mode_tree_search_callback`](/en/tmux/latest/reference/c-function-mode-tree-c-mode_tree_search_callback/) (function)
- [`mode_tree_search_free`](/en/tmux/latest/reference/c-function-mode-tree-c-mode_tree_search_free/) (function)

## Referenced declarations

- [`mode_tree_data.children`](/en/tmux/latest/reference/c-struct-mode_tree_data-children/) (attribute)
- [`mode_tree_item.children`](/en/tmux/latest/reference/c-struct-mode_tree_item-children/) (attribute)
- [`client`](/en/tmux/latest/reference/c-struct-client/) (struct)
- [`mode_tree_data.current`](/en/tmux/latest/reference/c-struct-mode_tree_data-current/) (attribute)
- [`mode_tree_item.entry`](/en/tmux/latest/reference/c-struct-mode_tree_item-entry/) (attribute)
- [`mode_tree_item.expanded`](/en/tmux/latest/reference/c-struct-mode_tree_item-expanded/) (attribute)
- [`mode_tree_data.filter`](/en/tmux/latest/reference/c-struct-mode_tree_data-filter/) (attribute)
- [`mode_tree_data.height`](/en/tmux/latest/reference/c-struct-mode_tree_data-height/) (attribute)
- [`mode_tree_line.item`](/en/tmux/latest/reference/c-struct-mode_tree_line-item/) (attribute)
- [`mode_tree_item.key`](/en/tmux/latest/reference/c-struct-mode_tree_item-key/) (attribute)
- [`key_code`](/en/tmux/latest/reference/c-typedef-key_code/) (typealias)
- [`KEYC_CTRL`](/en/tmux/latest/reference/c-define-tmux-h-keyc_ctrl/) (constant)
- [`KEYC_DOUBLECLICK1_PANE`](/en/tmux/latest/reference/c-enum-tmux-h-332237342172367247102064023371112372044056265234-keyc_doubleclick1_pane/) (constant)
- [`KEYC_DOWN`](/en/tmux/latest/reference/c-enum-tmux-h-332237342172367247102064023371112372044056265234-keyc_down/) (constant)
- [`KEYC_END`](/en/tmux/latest/reference/c-enum-tmux-h-332237342172367247102064023371112372044056265234-keyc_end/) (constant)
- [`KEYC_F1`](/en/tmux/latest/reference/c-enum-tmux-h-332237342172367247102064023371112372044056265234-keyc_f1/) (constant)
- [`KEYC_HOME`](/en/tmux/latest/reference/c-enum-tmux-h-332237342172367247102064023371112372044056265234-keyc_home/) (constant)
- [`KEYC_IS_MOUSE`](/en/tmux/latest/reference/c-define-tmux-h-keyc_is_mouse/) (constant)
- [`KEYC_LEFT`](/en/tmux/latest/reference/c-enum-tmux-h-332237342172367247102064023371112372044056265234-keyc_left/) (constant)
- [`KEYC_META`](/en/tmux/latest/reference/c-define-tmux-h-keyc_meta/) (constant)
- [`KEYC_MOUSEDOWN1_PANE`](/en/tmux/latest/reference/c-enum-tmux-h-332237342172367247102064023371112372044056265234-keyc_mousedown1_pane/) (constant)
- [`KEYC_MOUSEDOWN3_PANE`](/en/tmux/latest/reference/c-enum-tmux-h-332237342172367247102064023371112372044056265234-keyc_mousedown3_pane/) (constant)
- [`KEYC_NONE`](/en/tmux/latest/reference/c-enum-tmux-h-332237342172367247102064023371112372044056265234-keyc_none/) (constant)
- [`KEYC_NPAGE`](/en/tmux/latest/reference/c-enum-tmux-h-332237342172367247102064023371112372044056265234-keyc_npage/) (constant)
- [`KEYC_PPAGE`](/en/tmux/latest/reference/c-enum-tmux-h-332237342172367247102064023371112372044056265234-keyc_ppage/) (constant)
- [`KEYC_RIGHT`](/en/tmux/latest/reference/c-enum-tmux-h-332237342172367247102064023371112372044056265234-keyc_right/) (constant)
- [`KEYC_SHIFT`](/en/tmux/latest/reference/c-define-tmux-h-keyc_shift/) (constant)
- [`KEYC_UP`](/en/tmux/latest/reference/c-enum-tmux-h-332237342172367247102064023371112372044056265234-keyc_up/) (constant)
- [`KEYC_WHEELDOWN_PANE`](/en/tmux/latest/reference/c-enum-tmux-h-332237342172367247102064023371112372044056265234-keyc_wheeldown_pane/) (constant)
- [`KEYC_WHEELUP_PANE`](/en/tmux/latest/reference/c-enum-tmux-h-332237342172367247102064023371112372044056265234-keyc_wheelup_pane/) (constant)
- [`mode_tree_item.line`](/en/tmux/latest/reference/c-struct-mode_tree_item-line/) (attribute)
- [`mode_tree_data.line_list`](/en/tmux/latest/reference/c-struct-mode_tree_data-line_list/) (attribute)
- [`mode_tree_data.line_size`](/en/tmux/latest/reference/c-struct-mode_tree_data-line_size/) (attribute)
- [`mode_tree_data`](/en/tmux/latest/reference/c-struct-mode_tree_data/) (struct)
- [`MODE_TREE_PREVIEW_BIG`](/en/tmux/latest/reference/c-enum-mode_tree_preview-mode_tree_preview_big/) (constant)
- [`MODE_TREE_PREVIEW_NORMAL`](/en/tmux/latest/reference/c-enum-mode_tree_preview-mode_tree_preview_normal/) (constant)
- [`MODE_TREE_PREVIEW_OFF`](/en/tmux/latest/reference/c-enum-mode_tree_preview-mode_tree_preview_off/) (constant)
- [`MODE_TREE_SEARCH_BACKWARD`](/en/tmux/latest/reference/c-enum-mode_tree_search_dir-mode_tree_search_backward/) (constant)
- [`MODE_TREE_SEARCH_FORWARD`](/en/tmux/latest/reference/c-enum-mode_tree_search_dir-mode_tree_search_forward/) (constant)
- [`mouse_event`](/en/tmux/latest/reference/c-struct-mouse_event/) (struct)
- [`mode_tree_item.no_tag`](/en/tmux/latest/reference/c-struct-mode_tree_item-no_tag/) (attribute)
- [`mode_tree_data.offset`](/en/tmux/latest/reference/c-struct-mode_tree_data-offset/) (attribute)
- [`mode_tree_item.parent`](/en/tmux/latest/reference/c-struct-mode_tree_item-parent/) (attribute)
- [`mode_tree_data.preview`](/en/tmux/latest/reference/c-struct-mode_tree_data-preview/) (attribute)
- [`PROMPT_NOFORMAT`](/en/tmux/latest/reference/c-define-tmux-h-prompt_noformat/) (constant)
- [`PROMPT_TYPE_SEARCH`](/en/tmux/latest/reference/c-enum-prompt_type-prompt_type_search/) (constant)
- [`mode_tree_data.references`](/en/tmux/latest/reference/c-struct-mode_tree_data-references/) (attribute)
- [`sort_criteria.reversed`](/en/tmux/latest/reference/c-struct-sort_criteria-reversed/) (attribute)
- [`mode_tree_data.search_dir`](/en/tmux/latest/reference/c-struct-mode_tree_data-search_dir/) (attribute)
- [`mode_tree_data.sort_crit`](/en/tmux/latest/reference/c-struct-mode_tree_data-sort_crit/) (attribute)
- [`mode_tree_item.tagged`](/en/tmux/latest/reference/c-struct-mode_tree_item-tagged/) (attribute)
- [`mode_tree_data.width`](/en/tmux/latest/reference/c-struct-mode_tree_data-width/) (attribute)
- [`mode_tree_data.wp`](/en/tmux/latest/reference/c-struct-mode_tree_data-wp/) (attribute)
