Search code examples
c#flashtimerwaitshockwave

Timer to wait before each KeySend C#


I've just started and I still can't find an answer for this. I don't know how to make the timer wait a little before sending the next key.

As you can see this just executes them all at the same time then looping the process

        private void timer2_Tick(object sender, EventArgs e)
    {
        axShockwaveFlash1.Select();
        SendKeys.SendWait("{UP}");
        axShockwaveFlash1.Select();
        SendKeys.SendWait("{RIGHT}");
        axShockwaveFlash1.Select();
        SendKeys.SendWait("{DOWN}");
        axShockwaveFlash1.Select();
        SendKeys.SendWait("{LEFT}");
    }

Solution

  • I don't know what language it's, but a thing like

    Thread.Sleep();
    

    may be what you're looking for.

    EDIT: This function exists in C#