AddKeybindButton

Syntax

Groupbox:AddKeybindButton({
    Index = "unique tool index",
    Default = "[F4]",
    Text = "ESP Toggle Keybind: [F4]"
})
  • <string> Index - Allows for duplicate names. Must be unique.

  • <string> Default - The initial dx9ware keycode.

  • <string> Text - The initial text displayed on the KeybindButton (should display the Default).

KeybindButton Functions

KeybindButton:AddTooltip("Tooltip Text")
KeybindButton:SetText("ESP Toggle Keybind: [F3]")
KeybindButton:SetKey("[F3]")
KeybindButton:OnChanged(function(NewKey) end)

Example

Code shown below is missing some critical syntax for simplicity

--// Creating Groupbox
local Groupbox = Tab:AddLeftGroupbox("Demo Groupbox")

local keybindButton = Groupbox:AddKeybindButton({
	Index = "Test_Keybinder_1";
	Text = "Test Keybind: [F4]";
	Default = "[F4]";
}):AddTooltip("Tooltip Text")
keybindButton = keybindButton:OnChanged(function(newKey)
	local oldText = keybindButton.Text
	keybindButton:SetText("Test Keybind: "..tostring(newKey))
	local newText = keybindButton.Text
	lib_ui:Notify("Test Keybind Text set from '"..tostring(oldText).."' to '"..tostring(newText).."'", 1)
end)

Last updated