fivem icon indicating copy to clipboard operation
fivem copied to clipboard

Mouse cursor is locked to screen center when using SetNuiFocusKeepInput(true) with Windows Input

Open TheWordofMotch opened this issue 8 months ago • 1 comments

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

  1. Set Mouse Input Method to "Windows Input"
  2. Call SetNuiFocusKeepInput(true)
  3. Open NUI
  4. 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

TheWordofMotch avatar Mar 26 '26 12:03 TheWordofMotch

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

OneEarJoe5 avatar Nov 11 '26 17:11 OneEarJoe5