How can I use NUI focus exclusively with the mouse?
I’m creating a script that has a functionality similar to a cellphone, but I encountered a problem with the native function SetNuiFocus() in FiveM.
--SetNuiFocus
SetNuiFocus(hasFocus boolean, hasCursor boolean)
If I pass (true, true) as parameters, it adds focus to the interface, but the player is unable to move using W, A, S, D, etc.
SetNuiFocus(true, true)
If I pass (true, false), it adds focus to the NUI, but the mouse is not enabled to interact with the interface.
SetNuiFocus(true, false)
If I pass (false, true), it doesn’t add focus to the interface, it remains as if I had passed (false, false) as parameters.
SetNuiFocus(false, true)
Functions that I discovered by researching in other topics and tried to use:
I tried to use the function SetNuiFocusKeepInput(), however, this function doesn’t affect anything other than enabling or disabling the keyboard, as far as I noticed when using it.
--SetNuiFocusKeepInput
SetNuiFocusKeepInput(keepInput boolean)
If I pass (false) as a parameter, regardless of the sequence of parameters passed in the SetNuiFocus() function, the keyboard remains disabled.
SetNuiFocusKeepInput(false)