Keybinds
A global API containing a function to create new Keybind instances
This page is a WIP. It contains all the information in Figura's documentation but we're working on adding more helpful descriptions.
newKeybind()
Aliases: of()
Creates and returns a new Keybind
The name is used in the keybind menu
The key parameter is an identifier for a key, such as "key.keyboard.r"
The boolean gui indicates whether the keybind should always work, or if it should only work when you don't have a screen open
Check the docs enum command for all key names
- Overload 1
- Overload 2
- Overload 3
Example:
local myKey = keybinds:newKeybind("Name", "key.keyboard.h", false)
getVanillaKey()
Gets the id of the key bound to the given action, as a string
Check the docs enum command for all key names and vanilla actions
getVanillaKey(id)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id | String | - | - |
Returns:
Type | Description |
---|---|
String | - |
Example:
local myKey = keybinds:newKeybind("Name", keybinds:getVanillaKey("key.attack"), false)
fromVanilla()
Creates a new Keybind based from a vanilla key
fromVanilla(id)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id | String | - | - |
Returns:
Type | Description |
---|---|
Keybind | - |
Example:
local myKey = keybinds:fromVanilla("key.attack")
getKeybinds()
Returns a table with all registered keybinds
getKeybinds()
Returns:
Type | Description |
---|---|
Table | - |
Example:
keybinds:getKeybinds()