I want to simulate the LEFT and RIGHT Arrows key press when an IF condition gets true. Uptill now I have tried this so far, but it does not works. I am also controlling mouse using win32.dll import method. If I use the SendKeys.Send("LEFT"); method, my mouse movement does not get controlled. I feel like the code does not run after this call.
I have included system.windows.forms at top, what am I doing wrong?
How can I simulate arrows keys in a simple way?
if (shoulderLeft.Position.Z > shoulderRight.Position.Z)
{
status.Fill = new SolidColorBrush(System.Windows.Media.Colors.DarkBlue);
SendKeys.Send("LEFT");
// System.Windows.Forms.MessageBox.Show("Left ROTATION");
}
//right rotate
else if ((shoulderLeft.Position.Z < shoulderRight.Position.Z))
{
SendKeys.Send("RIGHT");
status.Fill = new SolidColorBrush(System.Windows.Media.Colors.Red);
}