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); }
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; }