mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 06:56:03 +01:00
Add helper functions to set nui focus and restore previous input state. Ensure focus is reset before triggering responses (promises/callbacks).
13 lines
319 B
Lua
13 lines
319 B
Lua
local keepInput = IsNuiFocusKeepingInput()
|
|
|
|
function lib.setNuiFocus(allowInput, disableCursor)
|
|
keepInput = IsNuiFocusKeepingInput()
|
|
SetNuiFocus(true, not disableCursor)
|
|
SetNuiFocusKeepInput(allowInput)
|
|
end
|
|
|
|
function lib.resetNuiFocus()
|
|
SetNuiFocus(false, false)
|
|
SetNuiFocusKeepInput(keepInput)
|
|
end
|