I want to make a key combination with Keys SHIFT + D hence when both keys are pressed, purpose X starts. But my Key D is also being used to start purpose Y. How do I make sure when I'm pressing the key SHIFT + D, purpose X and only Purpose X is started and not Purpose Y.
FYI --- Shift will be pressed before D.
I tried solving this problem myself, here is my code...
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == moveRight && isJumping != true && isHovering != true)
{
if (Shft_KeyPressed == true)// This block was suppose to fix my problem
{
canFly = true; // method for Purpose X will then start if this is true
} else
{
facingDirection = 1;
standTimer.Stop();
Walking_Animator(); // This is Purpose Y
}
} else if (e.Shift)
{
Shft_KeyPressed = true;
Flying_Animator(); // this is Purpose X
}
}