fivem
fivem copied to clipboard
Mouse cursor is locked to screen center when using SetNuiFocusKeepInput(true) with Windows Input
What happened?
When using SetNuiFocusKeepInput(true) with "Windows Input", the mouse cursor is forcefully reset to the center of the screen.
This issue does NOT occur when using DirectInput or Raw Input.
Actual Behavior
- The mouse position is constantly reset to the center of the screen
- Cursor movement is effectively restricted
Impact
This makes it difficult or impossible to use UI interactions properly while keeping game input active.
Expected result
The mouse cursor should move freely without being forced to a specific position.
Reproduction steps
- Set Mouse Input Method to "Windows Input"
- Call SetNuiFocusKeepInput(true)
- Open NUI
- Move the mouse
Importancy
There's a workaround
Area(s)
FiveM
Specific version(s)
Fivem 27430(Release) and 27417(Canary)
Additional information
- This issue only occurs when using "Windows Input"
- The issue does NOT occur with DirectInput or Raw Input
Could reproduce this, the game keeps recentering the cursor in "Windows Input" while KeepInput is on. Opened a fix: https://github.com/citizenfx/fivem/pull/4393