Keybind Selector
Hotkey listening widget that triggers functions on keyboard button presses.
Keybind Selector#
1local Keybind = Section:CreateKeybind(name, default, callback, description)
default (Enum.KeyCode): Base keybind button (e.g. Enum.KeyCode.RightControl).
Keybind Methods#
Keybind:SetKey(keyCode): Rebind hotkey programmatically.
Keybind:GetValue(): Returns current active keybind EnumItem.
Complete Code Example#
Here is a complete copy-pasteable script showing how to build keybind components for toggling the UI visibility:
1local ValincUi = loadstring(game:HttpGet("https://cdn.vinzhub.com/scripts/Liblery%20Ui/VALINC-QUARTZ/57319f29599c47672f19f8d56d53ffbe/a6b3ccb1f04d1d7d06232a9c5d25779e2af89c12992bebae.lua"))()
2
3local Window = ValincUi:CreateWindow("Keybind Hub", "keyboard", "gold")
4local Tab = Window:CreateTab("Settings")
5local Section = Tab:CreateSection("Hotkey Bindings")
6
7-- Create a functional keybind widget
8local ToggleBind = Section:CreateKeybind("Toggle UI Panel", Enum.KeyCode.RightControl, function()
9 -- Switch UI state when keybind key is pressed
10 local currentVisibleState = Window:GetVisible()
11 Window:SetVisible(not currentVisibleState)
12 print("UI visibility toggled!")
13end, "Press this key on your keyboard to show/hide the main script window.")