//public bool ToggleEnhancePointerPrecision() //{ // int[] mouseParams = new int[3];//necessary for enhancePointer // // toggle value, Get the current values. // DLL.SystemParametersInfoGet(DLL.SPI_GETMOUSE, 0, GCHandle.Alloc(mouseParams, GCHandleType.Pinned).AddrOfPinnedObject(), 0); // mouseParams[2] = 1 - mouseParams[2]; // // Update the system setting. // return DLL.SystemParametersInfoSet(DLL.SPI_SETMOUSE, 0, GCHandle.Alloc(mouseParams, GCHandleType.Pinned).AddrOfPinnedObject(), MouseKeyIO.SPIF.SPIF_SENDCHANGE); //} public bool GetEnhancePointerPrecision() { int[] mouseParams = new int[3];//necessary for enhancePointer // Get the current values. return(DLL.SystemParametersInfoGet(DLL.SPI_GETMOUSE, 0, GCHandle.Alloc(mouseParams, GCHandleType.Pinned).AddrOfPinnedObject(), 0)); }
public bool SetEnhancePointerPrecision(int state /*0 or 1*/) { int[] mouseParams = new int[3];//necessary for enhancePointer mouseParams[2] = state; // Update the system setting. return(DLL.SystemParametersInfoSet(DLL.SPI_SETMOUSE, 0, GCHandle.Alloc(mouseParams, GCHandleType.Pinned).AddrOfPinnedObject(), MouseKeyIO.SPIF.SPIF_SENDCHANGE)); }
public override void DoBeforeNextExecute() { CheckScriptTimer(); if (cmd == 'M') { if (SF == null) { //SF = new ScriptMouse(this); } SF.Mouse(); } // If a mouse command was given in the script, issue it all at once right here if ((int)deltaXOut != 0 || (int)deltaYOut != 0 || wheel != 0) { var input = new MouseKeyIO.INPUT[1]; input[0].type = MouseKeyIO.INPUT_MOUSE; input[0].mi = MouseInput((int)deltaXOut, (int)deltaYOut, (uint)wheel, 0, MouseKeyIO.MOUSEEVENTF_MOVE | MouseKeyIO.MOUSEEVENTF_WHEEL); DLL.SendInput(1, input, Marshal.SizeOf(input[0].GetType())); // Reset the mouse values if ((int)deltaXOut != 0) { deltaXOut = deltaXOut - (int)deltaXOut; } if ((int)deltaYOut != 0) { deltaYOut = deltaYOut - (int)deltaYOut; } wheel = 0; } currentMouseState = null; // flush the mouse state setPressedStrategy.Do(); }
public void setmouse(int x, int y) => DLL.SetCursorPos(x, y);
public SharpDX.Point getmouse() { DLL.GetCursorPos(out point); return(point); }