Sunshine, Moonlight, and FiveM
Streaming your Windows gaming PC to a eg a Steam Deck using
Sunshine and
Moonlight (which is what I do), is one of the best ways to get a high-quality remote gaming experience imo.
Low latency, excellent image quality, and the ability to play demanding games from anywhere make it an extremely powerful combination.
However, some games do not always behave nicely when multiple input systems are involved.
One of the strangest examples is
FiveM, where the mouse cursor can become stuck in the top-left corner of the screen, and you're left with a laggy mouse that does not work properly.
The Symptom: A Mouse That Refuses to Move
The issue appears when launching FiveM through a Sunshine/Moonlight stream:
- The game launches normally
- Character selection and menus may still work - but laaaagggyyyygyygygy
- The mouse appears stuck in the top-left corner
- Moving the mouse causes strange or unusable camera behaviour
At first glance, it looks like a mouse forwarding problem.
The Problem: Too Many Input Layers
When streaming from a Steam Deck, there are several input layers involved:
- The physical keyboard and mouse
- The Steam Deck's built-in controller
- The Steam Deck trackpads
- Moonlight input forwarding
- Sunshine virtual input devices
- Windows HID devices
- FiveM's own input handling
Hold on, while I catch my breath. That's a lot of input layers...
Most games handle this without issues. FiveM is different because it inherits GTA V's input system, which constantly switches between keyboard/mouse and controller input depending on what it detects.
This can create a situation where FiveM sees a controller appearing and disappearing while also receiving mouse input.
The result is a conflict between GTA's mouse capture system and the remote input layer.
The Obvious Fix That Did Not Work
The natural reaction is to remove every possible controller device:
- Disable Moonlight gamepad forwarding
- Disable Sunshine virtual controllers
- Remove virtual Xbox controllers from Windows
- Hide HID devices
While this can be the correct solution for some games, it did not solve the FiveM issue.
The problem was not necessarily that FiveM had a controller.
The problem was probably more likely that FiveM expected a stable controller state and did not receive one.
The Unexpected Fix: Stop Fighting the Controller
The solution was surprisingly simple. I figured, instead of fighting to
remove the controller, I would try to
ensure it was always connected.
The working configuration was:
- Run FiveM in Fullscreen Exclusive mode
- Enable Moonlight's
Force gamepad #1 always connected option

By forcing a permanent controller connection, FiveM no longer sees the input device changing during gameplay.
The keyboard and mouse can continue working normally through Moonlight.
Final Working Configuration
The setup that solved the issue:
Moonlight:
Force gamepad #1 always connected = Enabled
FiveM:
Fullscreen Exclusive = Enabled
Input:
Keyboard + Mouse through Moonlight
Comments (0)
No comments yet. Be the first to comment!
Leave a Comment