When Key pressed down and held Mouse stuck

when ever I press any key binded button and hold it my mouse will not move but if I press a key bind then just another random key while holding the original binds the mouse moves

But when it comes to moving or even went as far as sprinting my mouse moves.

So Example when i press the space bar to jump and attempt to look around he wont look if i hold the space bar the mouse wont move at all and completely freezes in the center of the screen.
Another Example
I have a menu that pops up when you hold the “M” key the menu pops up the mouse is stuck on the center of the screen while holding m down. To get it unstuck I can hold M down then use the arrow keys to move my player and the mouse gets unstuck.

Might need to see what your code looks like.