> For the complete documentation index, see [llms.txt](https://luffyyy.gitbook.io/beardlib/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://luffyyy.gitbook.io/beardlib/menuui/menuui-keybind.md).

# Keybind

Updated for version 3.36.

**It's recommended to first read about the base item before reading about other items** <https://luffyyy.gitbook.io/beardlib/menuui/menuui-item>

## Keybind

### Creation

```lua
MyRandomMenu:Keybind({
    name = "MyKeybind",
    text = "Keybind item",
    value = "f1",
    on_callback = ClassClbk(self, "MyClbk")
})
```

### Parameters

| Parameter          | Return Type | Description                                                                             |
| ------------------ | ----------- | --------------------------------------------------------------------------------------- |
| value              | String      | The keybind key. Defaults to none                                                       |
| supports\_keyboard | Boolean     | Should the item listen to the keyboard? Defaults to true and the value can be inherited |
| supports\_mouse    | Boolean     | Should the item listen to the mouse? Defaults to false and the value can be inherited   |

### Functions

#### Get

| Function     | Return Type | Description                              |
| ------------ | ----------- | ---------------------------------------- |
| Value()      | String      | Returns the keybind as a string          |
| GetKeyBind() | Idstring    | Returns the keybind but in idstring form |

#### Set

| Function                                      | Description                                                                                                                          |
| --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| SetValue(String value, Boolean run\_callback) | Sets the value of the item. `value` is the keybind key and `run_callback` decides whether to run the callback after the value is set |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://luffyyy.gitbook.io/beardlib/menuui/menuui-keybind.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
