Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pages/ox_lib/Modules/AddKeybind/Client.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ A table representing a keybind with the following properties.
- An optional secondary keybind.
- secondaryMapper?: `string`
- An optional mapper for the secondary key, otherwise using the default mapper.
- allowInPauseMenu?: `boolean`
- Allows the keybind to trigger while the pause menu/frontend is active.
- Default: `false`
- disable: `function(self: CKeybind, disable: boolean)`
- Built-in function to enable / disable a keybind
- isControlPressed: `function(self: CKeybind)`
Expand Down Expand Up @@ -52,6 +55,9 @@ lib.addKeybind(data)
- Default: `keyboard`
- secondaryKey?: `string`
- secondaryMapper?: `string`
- allowInPauseMenu?: `boolean`
- Default: `false`
- If true, keybind callbacks can run while `IsPauseMenuActive()` is true
- disabled?: `boolean`
- Whether or not the keybind should be disabled by default
- onPressed?: `function(self: CKeybind)`
Expand All @@ -64,6 +70,7 @@ local keybind = lib.addKeybind({
name = 'respects',
description = 'press F to pay respects',
defaultKey = 'F',
allowInPauseMenu = true,
onPressed = function(self)
print(('pressed %s (%s)'):format(self.currentKey, self.name))
end,
Expand Down