Пример #1
0
        public override void KeyDownAction()
        {
            //Thread t = new Thread(lol);
            //t.Start();
            Console.WriteLine("holddown");
            Random r = new Random();
            var    x = r.Next(Area.X_min, Area.X_max);
            var    y = r.Next(Area.Y_min, Area.Y_max);

            new Thread(() =>
            {
                flag = true;
                m_contact[0].PointerInfo.PointerType = PointerInputType.Touch;

                m_contact[0].PointerInfo.PointerId = (uint)0;
                TouchInjection.InitializeTouchInjection(MaxTouchCount, TouchFeedback.Indirect);
                m_contact[0].PointerInfo.PointerFlags    = PointerFlags.InRange | PointerFlags.InContact | PointerFlags.Down;
                m_contact[0].PointerInfo.PixelLocation.X = (int)x;  //960 teszt
                m_contact[0].PointerInfo.PixelLocation.Y = (int)y;  //960 teszt
                TouchInjection.InjectTouchInput(1, m_contact);
                while (flag)
                {
                    m_contact[0].PointerInfo.PointerFlags = PointerFlags.InRange | PointerFlags.InContact | PointerFlags.Update;
                    TouchInjection.InjectTouchInput(1, m_contact);
                    Thread.Sleep(20);
                }
            }).Start();
        }
Пример #2
0
        public override void KeyDownAction()
        {
            //Thread t = new Thread(lol);
            //t.Start();
            Random r = new Random();
            var    x = r.Next(Area.X_min, Area.X_max);
            var    y = r.Next(Area.Y_min, Area.Y_max);

            m_contact[0].PointerInfo.PointerType = PointerInputType.Touch;
            m_contact[0].PointerInfo.PointerId   = (uint)0;
            TouchInjection.InitializeTouchInjection(MaxTouchCount, TouchFeedback.Indirect);
            m_contact[0].PointerInfo.PointerFlags    = PointerFlags.InRange | PointerFlags.InContact | PointerFlags.Down;
            m_contact[0].PointerInfo.PixelLocation.X = (int)x;
            m_contact[0].PointerInfo.PixelLocation.Y = (int)y;
            TouchInjection.InjectTouchInput(1, m_contact);
            m_contact[0].PointerInfo.PointerFlags = PointerFlags.Up;
            TouchInjection.InjectTouchInput(1, m_contact);
        }
Пример #3
0
 public override void KeyUpAction()
 {
     flag = false;
     m_contact[0].PointerInfo.PointerFlags = PointerFlags.Up;
     TouchInjection.InjectTouchInput(1, m_contact);
 }