How to get mouse side to side movement

I am making a spaceship game. And I want to use the mouse to control the pitch and yaw, but there is only mouse x and mouse y. I want to use the side to side movement of the mouse to do that.