예제 #1
0
        public static bool Init()
        {
            try
            {
                DM       = new CDmSoft();
                KeyInput = ((int vk, KeyFlag flag) => {
                    switch (flag)
                    {
                    case KeyFlag.Down: DM.KeyDown(vk); break;

                    case KeyFlag.Up: DM.KeyUp(vk); break;

                    case KeyFlag.Press: DM.KeyPress(vk); break;
                    }
                });
                MouseInput = ((int x, int y, MouseFlag flag, int data) => {
                    switch (flag)
                    {
                    case MouseFlag.MoveTo: DM.MoveTo(x, y); break;

                    case MouseFlag.AddTo: DM.MoveR(x, y); break;

                    case MouseFlag.Wheel:
                        if (data > 0)
                        {
                            DM.WheelUp();
                        }
                        else
                        {
                            DM.WheelDown();
                        }
                        break;

                    case MouseFlag.LeftDown: DM.LeftDown(); break;

                    case MouseFlag.LeftUp: DM.LeftUp(); break;

                    case MouseFlag.RightDown: DM.RightDown(); break;

                    case MouseFlag.RightUp: DM.RightUp(); break;
                    }
                });
            }
            catch
            {
                KeyInput   = KeyEvent.KeySend;
                MouseInput = KeyEvent.MouseSend;
                return(false);
            }
            return(true);
        }
예제 #2
0
파일: Input.cs 프로젝트: KeyMove/KMButton
 public static bool Init()
 {
     try
     {
         DM = new CDmSoft();
         KeyInput = ((int vk, KeyFlag flag) => {
             switch (flag)
             {
                 case KeyFlag.Down: DM.KeyDown(vk); break;
                 case KeyFlag.Up: DM.KeyUp(vk); break;
                 case KeyFlag.Press: DM.KeyPress(vk); break;
             }
         });
         MouseInput=((int x, int y, MouseFlag flag,int data)=>{
             switch (flag)
             {
                 case MouseFlag.MoveTo: DM.MoveTo(x, y); break;
                 case MouseFlag.AddTo: DM.MoveR(x, y); break;
                 case MouseFlag.Wheel:
                     if (data > 0)
                         DM.WheelUp();
                     else
                         DM.WheelDown();
                     break;
                 case MouseFlag.LeftDown: DM.LeftDown(); break;
                 case MouseFlag.LeftUp: DM.LeftUp(); break;
                 case MouseFlag.RightDown: DM.RightDown(); break;
                 case MouseFlag.RightUp: DM.RightUp(); break;
             }
         });
     }
     catch
     {
         KeyInput = KeyEvent.KeySend;
         MouseInput = KeyEvent.MouseSend;
         return false;
     }
     return true;
 }