public static void Wheel(int delta) { object minput = new MouseInput(WindowsConstants.MOUSEEVENTF_WHEEL, GetMessageExtraInfo()); var prop = minput.GetType().GetField("mouseData", BindingFlags.NonPublic | BindingFlags.Instance); prop.SetValue(minput, 120 * delta); Input input = InputFactory.Mouse((MouseInput)minput); // Added check for 32/64 bit if (IntPtr.Size == 4) { var v = SendInput(1, ref input, Marshal.SizeOf(typeof(Input))); } else { var input64 = new Input64(input); SendInput64(1, ref input64, Marshal.SizeOf(typeof(Input))); } }
/// <summary> /// Performs an up for the specified button /// </summary> internal static void MouseButtonUp(MouseButton mouseButton) { SendInput(InputFactory.Mouse(GetInputForButton(mouseButton, false))); }
/// <summary> /// Performs a down for the specified button /// </summary> internal static void MouseButtonDown(MouseButton mouseButton) { SendInput(InputFactory.Mouse(GetInputForButton(mouseButton, true))); }
public virtual void RightClick() { SendInput(InputFactory.Mouse(MouseInput(RightMouseButtonDown))); SendInput(InputFactory.Mouse(MouseInput(RightMouseButtonUp))); }
public static void LeftDown() { SendInput(InputFactory.Mouse(MouseInput(LeftMouseButtonDown))); }
public static void LeftUp() { SendInput(InputFactory.Mouse(MouseInput(LeftMouseButtonUp))); }
public virtual void RightClick() { SendInput(InputFactory.Mouse(MouseInput(WindowsConstants.MOUSEEVENTF_RIGHTDOWN))); SendInput(InputFactory.Mouse(MouseInput(WindowsConstants.MOUSEEVENTF_RIGHTUP))); }
public static void LeftDown() { SendInput(InputFactory.Mouse(MouseInput(WindowsConstants.MOUSEEVENTF_LEFTDOWN))); }