Exemplo n.º 1
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (radioButton1.Checked == true)
            {
                int ddcode = 300;                  //tab == 300 in ddcode
                dd.key(ddcode, 1);                 //1=down
                System.Threading.Thread.Sleep(50); //may, delay 50ms
                dd.key(ddcode, 2);                 //2 = up
                return;
            }

            if (radioButton2.Checked == true)
            {
                //'1==L.down, 2==L.up, 4==R.down, 8==R.up, 16==M.down, 32==M.up
                dd.btn(1);
                System.Threading.Thread.Sleep(50);           //may, delay 50ms
                dd.btn(2);
                return;
            }

            if (radioButton3.Checked == true)
            {
                dd.movR(20, 20);  //move rel.
                dd.mov(200, 200); //move abs.
                return;
            }

            if (radioButton4.Checked == true)
            {
                dd.whl(1);                                  //up
                System.Threading.Thread.Sleep(1000);
                dd.whl(2);                                  //down
            }
        }
Exemplo n.º 2
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            if (radioButton1.Checked == true)      // 测试键盘按键
            {
                int ddcode = 300;                  //tab键位在DD键码表的3区第1个位置
                dd.key(ddcode, 1);
                dd.key(ddcode, 2);                 // 1=按下 2=放开
                return;
            }

            if (radioButton2.Checked == true)     //测试鼠标点击
            {
                dd.btn(1);                        // 1=左键按下
                dd.btn(2);                        // 2=左键放开
                return;
            }

            if (radioButton3.Checked == true)    //测试鼠标移动
            {
                dd.movR(100, 100);
                return;
            }

            if (radioButton4.Checked == true)   //测试鼠标滚轮
            {
                dd.whl(1);                      //前
                System.Threading.Thread.Sleep(1000);
                dd.whl(2);                      //后
            }
        }