Keybind
Keybinds attach keyboard shortcuts to toggles or labels for quick actions.
Playground
Example Toggle
F
Leave blank to use the default modes list.
Keep toggle value in sync
Do not show in keybind list
Usage
You can create a Keybind by calling the AddKeyPicker
method on a toggle or label reference.
Keybinds can hang off any element that returns a reference (for example AddToggle
or AddLabel
).
Arguments
Arg Idx | Argument Description | Type | Default |
---|---|---|---|
1 | Index/ID of the keybind | string | nil |
2 | Keybind configuration table | table | nil |
Configuration Table
Prop
Type
Methods
You can use the following methods to interact with the keybind:
SetValue
Sets the key and mode.
Arg Idx | Argument Description | Type | Default |
---|---|---|---|
1 | Table containing { key, mode } | table | nil |
GetState
Returns whether the keybind is active.
Arg Idx | Argument Description | Type | Default |
---|---|---|---|
1 | No arguments | – | – |
SetText
Updates the keybind's text.
Arg Idx | Argument Description | Type | Default |
---|---|---|---|
1 | New keybind text | string | nil |
Update
Refreshes the keybind display.
Arg Idx | Argument Description | Type | Default |
---|---|---|---|
1 | No arguments | – | – |
OnClick
Sets the click callback.
Arg Idx | Argument Description | Type | Default |
---|---|---|---|
1 | Callback executed on click | function | nil |
OnChanged
Sets the change callback.
Arg Idx | Argument Description | Type | Default |
---|---|---|---|
1 | Callback executed when the keybind changes | function | nil |