> For the complete documentation index, see [llms.txt](https://walksy.gitbook.io/walksylib-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://walksy.gitbook.io/walksylib-docs/keybinds/local-and-vanilla-keybinds.md).

# Local and Vanilla Keybinds

WalksyLib has two kinds of keybind.

## Vanilla keybinds: `WLKeyMapping.create`

```java
WLKeyMapping.create("Toggle", GLFW.GLFW_KEY_R, "My Mod");
```

* Registered with Minecraft, so they appear in **Options → Controls** under your category.
* Saved in Minecraft's `options.txt`.
* Must be created at startup, before the game finishes loading. Minecraft can't add controls later.

Use these for your mod's fixed, main keybinds.

## Local keybinds: `WLKeyMapping.createLocal`

```java
WLKeyMapping.createLocal("Load " + kitName, GLFW.GLFW_KEY_UNKNOWN, "Kits");
```

* **Not** registered with Minecraft.
* Can be created and removed at any time.
* Saved by WalksyLib when shown in your config with `Options.ofKeybind(...)`.

Use these for keybinds created at runtime, such as one keybind per kit, profile or page.

## Which should I use?

|                                     | `create` | `createLocal` |
| ----------------------------------- | -------- | ------------- |
| Shown in vanilla Controls           | Yes      | No            |
| Shown on WalksyLib's Key Binds page | Yes      | Yes           |
| Can be created at runtime           | No       | Yes           |
| Can be removed                      | Yes      | Yes           |
