C#Mouse Move在游戏

时间:2016-11-27 15:56:20

标签: c# mouse

        private void button1_Click(object sender, EventArgs e)
    {
        InitializeComponent();
        System.Windows.Forms.Timer ShakerZwei = new System.Windows.Forms.Timer();
        System.Windows.Forms.Timer SechsSekunden = new System.Windows.Forms.Timer();
        ShakerZwei.Interval = 6800;
        SechsSekunden.Interval = 6000;
        SechsSekunden.Tick += new EventHandler(MausBewegung);
        ShakerZwei.Tick += new EventHandler(MausBewegungZurück);
        SechsSekunden.Start();
        ShakerZwei.Start();
    }
    void MausBewegung(object sender, EventArgs e)
    {
        Cursor.Position = new Point(Cursor.Position.X + 10, Cursor.Position.Y + 10);
    }
    void MausBewegungZurück(object sender, EventArgs e)
    {
        Cursor.Position = new Point(Cursor.Position.X - 10, Cursor.Position.Y - 10);
    }

我的代码无处不在,但在相机没有的游戏中,我已经尝试更改“-10”或“+10”,仍然无法正常工作。还有另一种方法可以将光标移动到2点之间吗?

0 个答案:

没有答案
相关问题