fivem icon indicating copy to clipboard operation
fivem copied to clipboard

Setting "SetNuiFocusKeepInput" and Cursor in two UIs (first true -> second false) is not updated properly

Open Merec opened this issue 4 months ago • 1 comments

What happened?

We are having two UIs that can be opened and interacted with at the same time.

First UI (Phone) is setting SetNuiFocus(true, true); -> cursor is visible -> correct SetNuiFocusKeepInput(true); -> game controls are working -> correct

The second UI (Interaction menu) now sets SetNuiFocus(true, false); -> cursor is still visible -> not correct SetNuiFocusKeepInput(false); -> game controls are still working -> not correct

Also IsNuiFocusKeepingInput() confirms this behavior and returns 1 (should be true instead btw.).

Currently I've implemented a workaround using SetPlayerControl(player, false, 0); but that adds a lot things to remember later on.

Expected result

The focus settings from the most active focused UI should have priority

Reproduction steps

Importancy

There's a workaround

Area(s)

FiveM

Specific version(s)

latest beta (18443)

Additional information

Pure JS server/client implementation

Merec avatar Aug 16 '25 22:08 Merec

Hi, it's designed to work like that. If a resource sets NUI focus, then it has to remove it itself.

Dani4Web avatar Dec 05 '25 12:12 Dani4Web