Example #1
0
        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)));
            }
        }
Example #2
0
 /// <summary>
 /// Performs an up for the specified button
 /// </summary>
 internal static void MouseButtonUp(MouseButton mouseButton)
 {
     SendInput(InputFactory.Mouse(GetInputForButton(mouseButton, false)));
 }
Example #3
0
 /// <summary>
 /// Performs a down for the specified button
 /// </summary>
 internal static void MouseButtonDown(MouseButton mouseButton)
 {
     SendInput(InputFactory.Mouse(GetInputForButton(mouseButton, true)));
 }
Example #4
0
 public virtual void RightClick()
 {
     SendInput(InputFactory.Mouse(MouseInput(RightMouseButtonDown)));
     SendInput(InputFactory.Mouse(MouseInput(RightMouseButtonUp)));
 }
Example #5
0
 public static void LeftDown()
 {
     SendInput(InputFactory.Mouse(MouseInput(LeftMouseButtonDown)));
 }
Example #6
0
 public static void LeftUp()
 {
     SendInput(InputFactory.Mouse(MouseInput(LeftMouseButtonUp)));
 }
Example #7
0
 public virtual void RightClick()
 {
     SendInput(InputFactory.Mouse(MouseInput(WindowsConstants.MOUSEEVENTF_RIGHTDOWN)));
     SendInput(InputFactory.Mouse(MouseInput(WindowsConstants.MOUSEEVENTF_RIGHTUP)));
 }
Example #8
0
 public static void LeftDown()
 {
     SendInput(InputFactory.Mouse(MouseInput(WindowsConstants.MOUSEEVENTF_LEFTDOWN)));
 }