Mouse direction?

Hello,

I’m looking for a way to check if the user is moving the mouse left or right. Like if the user moves the mouse on the right, something happens, but if he suddenly mouse left something else happen and so om… Any idea on how to do that?

TiA :}