From 765ef9d7fcd25686e22f5795a3e1773eede138ed Mon Sep 17 00:00:00 2001 From: PaPi <89279156+Mesrine67@users.noreply.github.com> Date: Tue, 26 May 2026 01:59:29 +0200 Subject: [PATCH] Introduce allowInPauseMenu for keybinds Added 'allowInPauseMenu' option to keybind configuration. https://github.com/overextended/ox_lib/pull/781 Signed-off-by: PaPi <89279156+Mesrine67@users.noreply.github.com> --- pages/ox_lib/Modules/AddKeybind/Client.mdx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pages/ox_lib/Modules/AddKeybind/Client.mdx b/pages/ox_lib/Modules/AddKeybind/Client.mdx index 1072499be..2b6fbb657 100644 --- a/pages/ox_lib/Modules/AddKeybind/Client.mdx +++ b/pages/ox_lib/Modules/AddKeybind/Client.mdx @@ -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)` @@ -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)` @@ -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,