Keybind

Represents a key binding for your script
Instances are obtained using the KeybindAPI's create() function

Keybind.getName

Gets the name of the keybind, which you set when you created the keybind
overload 1:
Keybind:getName()
Method Property Fluent Description Representation
Return Value a String

Keybind.getKey

Gets the current key for this keybind
overload 1:
Keybind:getKey()
Method Property Fluent Description Representation
Return Value a String

Keybind.isDefault

Checks whether this key is currently set to its default state (not been changed using the keybind menu)
overload 1:
Keybind:isDefault()
Method Property Fluent Description Representation
Return Value a Boolean

Keybind.getID

Returns the numeric ID of this keybind
overload 1:
Keybind:getID()
Method Property Fluent Description Representation
Return Value an Integer

Keybind.isEnabled

Returns if this keybind is enabled or not
overload 1:
Keybind:isEnabled()
Method Property Fluent Description Representation
Return Value a Boolean

Keybind.setKey

Sets the key for this keybind
overload 1:
Keybind:setKey(key)
Method Property Fluent Description Representation
key accepts a String
Return Value a Keybind

Keybind.setOnRelease

Sets the function that is executed when this key is released
The function has two arguments
The first argument is a number containing a bitmask of the currently held modifier keys
Shift = 1,
Ctrl = 2, Alt = 4
The second argument is this keybind itself
overload 1:
Keybind:setOnRelease(function)
Method Property Fluent Description Representation
function accepts a function
Return Value a Keybind

Keybind.isPressed

Gets whether this keybind is currently pressed down
overload 1:
Keybind:isPressed()
Method Property Fluent Description Representation
Return Value a Boolean

Keybind.getKeyName

Gets the name of the current key for this keybind
overload 1:
Keybind:getKeyName()
Method Property Fluent Description Representation
Return Value a String

Keybind.setOnPress

Sets the function that is executed when this key is pressed
The function has two arguments
The first argument is a number containing a bitmask of the currently held modifier keys
Shift = 1,
Ctrl = 2, Alt = 4
The second argument is this keybind itself
overload 1:
Keybind:setOnPress(function)
Method Property Fluent Description Representation
function accepts a function
Return Value a Keybind

Keybind.isGuiEnabled

Returns if this keybind should work when a GUI screen (Chat, Inventory, etc) is open or not
overload 1:
Keybind:isGuiEnabled()
Method Property Fluent Description Representation
Return Value a Boolean

Keybind.setGUI

Set whenever or not this keybind should run when a GUI screen is open
overload 1:
Keybind:setGUI(bool)
Method Property Fluent Description Representation
bool accepts a Boolean
Return Value a Keybind

Keybind.setEnabled

Toggles if this keybind should be processed or not
overload 1:
Keybind:setEnabled(bool)
Method Property Fluent Description Representation
bool accepts a Boolean
Return Value a Keybind

Keybind.key

Sets the key for this keybind
overload 1:
Keybind:key(key)
Method Property Fluent Description Representation
key accepts a String
Return Value a Keybind

Keybind.onRelease

Sets the function that is executed when this key is released
The function has two arguments
The first argument is a number containing a bitmask of the currently held modifier keys
Shift = 1,
Ctrl = 2, Alt = 4
The second argument is this keybind itself
overload 1:
Keybind:onRelease(function)
Method Property Fluent Description Representation
function accepts a function
Return Value a Keybind

Keybind.onPress

Sets the function that is executed when this key is pressed
The function has two arguments
The first argument is a number containing a bitmask of the currently held modifier keys
Shift = 1,
Ctrl = 2, Alt = 4
The second argument is this keybind itself
overload 1:
Keybind:onPress(function)
Method Property Fluent Description Representation
function accepts a function
Return Value a Keybind

Keybind.gui

Set whenever or not this keybind should run when a GUI screen is open
overload 1:
Keybind:gui(bool)
Method Property Fluent Description Representation
bool accepts a Boolean
Return Value a Keybind

Keybind.enabled

Toggles if this keybind should be processed or not
overload 1:
Keybind:enabled(bool)
Method Property Fluent Description Representation
bool accepts a Boolean
Return Value a Keybind

Keybind.press

A function that runs when the key is pressed down
The function has two arguments
The first argument is a number containing a bitmask of the currently held modifier keys
Shift = 1,
Ctrl = 2, Alt = 4
The second argument is this keybind itself
If the return value is true then all vanilla keybinds using same key will be ignored
field signature:
press
Method Property Fluent Description Representation
Field Type a function

Keybind.release

A function that runs when the key is released
The function has two arguments
The first argument is a number containing a bitmask of the currently held modifier keys
Shift = 1,
Ctrl = 2, Alt = 4
The second argument is this keybind itself
If the return value is true then all vanilla keybinds using same key will be ignored
field signature:
release
Method Property Fluent Description Representation
Field Type a function
a a