logoWindUI Shiny

Toggle Keybind

Toggle control combined with assignable hotkey.

Toggle Keybind

ToggleKeybind combines a toggle/checkbox control with an assignable hotkey.

Create

local TK = MainTab:ToggleKeybind({
    Title = "Kill Aura",
    Desc = "Toggle with keybind",
    Type = "Toggle",
    Value = false,
    Keybind = Enum.KeyCode.G,
    CanChange = true,
    Callback = function(state)
        print("Kill Aura:", state)
    end,
})

Config

KeyTypeDefault
Titlestring"Toggle Keybind"
Descstring?nil
Lockedbooleanfalse
LockedTitlestring?nil
Valuebooleanfalse
Iconstring?nil
IconSizenumber23
Type"Toggle" | "Checkbox""Toggle"
Callbackfunctionempty function
Keybind / Bind / KeyEnumItem | string"F"
CanChangebooleantrue

Methods

MethodSignatureDescription
LockTK:Lock()Locks interaction
UnlockTK:Unlock()Unlocks interaction
SetTK:Set(value, isCallback, isAnim)Sets toggle value
SetKeybindTK:SetKeybind(keyOrEnum)Sets activation key
SetTitleTK:SetTitle(text)Updates visible title
SetDescTK:SetDesc(text)Updates visible description
HighlightTK:Highlight()Brief highlight animation

Full Example (All Toggle Keybind Methods)

local TK = MainTab:ToggleKeybind({
    Title = "Kill Aura",
    Desc = "Press G to toggle",
    Type = "Checkbox",
    Value = false,
    Keybind = "G",
    CanChange = true,
    Callback = function(state)
        print("Toggle state:", state)
    end,
})

TK:Set(true, true, false)
TK:Set(false, false, true)
TK:SetKeybind("MouseLeft")

TK:SetTitle("Kill Aura Key")
TK:SetDesc("Now bound to left mouse")
TK:Highlight()

TK:Lock()
task.wait(0.5)
TK:Unlock()

On this page