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