I'm trying to create a simple automated key presser. It works fine on notepad, etc. but it does not work in the game window.
Do you have any idea ?
namespace PoyBot
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.TopMost = true;
}
private void button1_Click(object sender, EventArgs e)
{
timer1.Start();
//timer2.Start();
}
private void button2_Click(object sender, EventArgs e)
{
timer1.Stop();
//timer2.Stop();
}
private void timer1_Tick(object sender, EventArgs e)
{
if (checkBox1.Checked)
{
SendKeys.SendWait("z7");
}
else if (checkBox2.Checked)
{
SendKeys.Send("z8");
}
}
private void timer2_Tick(object sender, EventArgs e)
{
if (checkBox3.Checked)
{
SendKeys.Send("0");
}
}
}
}