Mouse stops responding ingame

So i was playing, singleplayer, when i figured out the the mouse was very instable on gmod, i mean , sometimes it works, and 2 seconds later it stops responding.And no it’s not the mouse battery, i verified.

I bet it’s the mouse, not the game. Does your mouse work out of game?