Client
addKeybind
fjsf.addKeybind(name, options, handler)Registers a client-side keybind with press and release detection.
Internally uses the FiveM +command / -command pattern.
The handler is called with true when the key is pressed and false when the key is released.
Parameters
name
stringUnique keybind name. Used to generate internal command names:+<name>β key pressed-<name>β key released Must be unique within the resource.
options
table | nilOptional configuration table. Supported fields:label
stringβ Display name shown in keybind settingsdefaultKey
stringβ Primary default key (e.g."E")secondaryKey
stringβ Secondary default key (optional)
handler
functionCallback function executed on key state change. Receives one argument:isPressed
booleanβtruewhen pressed,falsewhen released
Returns
This function does not return anything.
Example
Last updated