Skip to main content
Also has everything from ElementHandle. A keybind picker. Value is the chosen key (Enum.KeyCode, Enum.UserInputType, or nil).
Value typeEnum.KeyCode | Enum.UserInputType | nil
Default mode"onPress"
Created bySection:AddKey

Creation

section:AddKey(key, label, default?, mode?)
mode
KeyMode
See KeyMode. Controls when OnCallback reports active.

SetKey

keyHandle:SetKey(key: Enum.KeyCode | Enum.UserInputType | nil): ()
Set the keybind. Pass nil to clear it.

SetMode

keyHandle:SetMode(mode: KeyMode): ()
ModeWhat active means
"onPress"true while held after press
"onRelease"Fires on release
"onHold"true while held
"toggle"Toggles on each press

OnCallback

keyHandle:OnCallback(callback: (active: boolean) -> ()): () -> ()
Runs cb(active). What active means depends on the mode (e.g. true while held in "onHold").

SetListening

keyHandle:SetListening(listening: boolean): ()
Manually put the picker into “waiting for input” mode. GetValue / SetValue are the bound key.