I need to find out the direction (Left or RIGHT) of a mouse from the moment the mouse is being pressed.
I can use only the event OnMouseMove.
Using the following method I cannot get the direction as e.GetPosition(this).X it is the same value when the mouse move and when it is clicked.
Any idea how to solve it?
protected override void OnMouseMove(MouseEventArgs e)
{
currentPositionX = e.GetPosition(this).X;
if (e.LeftButton == MouseButtonState.Pressed)
{
double deltaDirection = currentPositionX - e.GetPosition(this).X;
direction = deltaDirection > 0 ? 1 : -1;
}
}