示例#1
0
        public void DoubleClick(PointerButtons button, double offsetX, double offsetY)
        {
            var num1 = (int)ActionHandler.Invoke(sender: this, actionInfo: ActionEventArgs.GetDefault(action: "WaitForReady"));
            var num2 = (int)ActionHandler.Invoke(sender: this, actionInfo: ActionEventArgs.GetDefault(action: "MakeVisible"));

            DoubleClickImplementation(button: button, offsetX: offsetX, offsetY: offsetY);
        }
示例#2
0
        public virtual void Release(PointerButtons button)
        {
            var inputList = Up(button: button, modifierKeys: ModifierKeys.None);

            inputList.Add(item: Input.CreateWait(duration: 100));
            this.inputQueue.Process(inputDevice: this.inputDevice, inputList: inputList);
        }
示例#3
0
 public static void ClickDrag(
     UIObject targetObject,
     UIObject destinationObject,
     PointerButtons button)
 {
     Move(uiObject: targetObject);
     ClickDrag(endPoint: destinationObject.GetClickablePoint(), button: button, dragDuration: DefaultDragDuration);
 }
示例#4
0
        public void DoubleClick(PointerButtons button)
        {
            var num1 = (int)ActionHandler.Invoke(sender: this, actionInfo: ActionEventArgs.GetDefault(action: "WaitForReady"));
            var num2 = (int)ActionHandler.Invoke(sender: this, actionInfo: ActionEventArgs.GetDefault(action: "MakeVisible"));
            var fromUpperLeftCorner = ComputeOffsetFromUpperLeftCorner();

            DoubleClickImplementation(button: button, offsetX: fromUpperLeftCorner.X, offsetY: fromUpperLeftCorner.Y);
        }
示例#5
0
 static void ClickImplementation(
     UIObject uiObject,
     PointerButtons button,
     uint numClicks)
 {
     Move(uiObject: uiObject);
     Click(button: button, count: (int)numClicks);
 }
示例#6
0
 public static void DoubleClick(
     UIObject uiObject,
     PointerButtons button,
     double offsetX,
     double offsetY)
 {
     ClickImplementation(uiObject: uiObject, button: button, numClicks: 2U, offsetX: offsetX, offsetY: offsetY);
 }
示例#7
0
 protected void DoubleClickImplementation(PointerButtons button, double offsetX, double offsetY)
 {
     if (ActionHandler.Invoke(sender: this, actionInfo: new ActionEventArgs(action: "DoubleClick", button, (object)offsetX, (object)offsetY)) != ActionResult.Unhandled)
     {
         return;
     }
     MovePointer(offsetX: offsetX, offsetY: offsetY);
     PointerInput.Click(button: button, count: 2);
 }
示例#8
0
        IList <IInputAction> Up(
            PointerButtons button,
            ModifierKeys modifierKeys)
        {
            var inputActionList = new List <IInputAction>();

            inputActionList.Add(item: Input.CreateMouseUpInput(button: button, swapped: GetMouseButtonsSwapped()));
            inputActionList.AddRange(collection: Input.CreateKeyModifierInputs(modifierKeys: modifierKeys, press: false, duration: Keyboard.SendKeysDelay));
            return(inputActionList);
        }
示例#9
0
 static void ClickImplementation(
     UIObject uiObject,
     PointerButtons button,
     uint numClicks,
     double offsetX,
     double offsetY)
 {
     Move(uiObject: uiObject, offsetX: offsetX, offsetY: offsetY);
     Click(button: button, count: (int)numClicks);
 }
示例#10
0
        public void ClickDrag(PointI endPoint, PointerButtons button, uint dragDuration)
        {
            var inputActionList = new List <IInputAction>();

            inputActionList.AddRange(collection: Down(button: button, modifierKeys: ModifierKeys.None));
            inputActionList.Add(item: Input.CreateWait(duration: (int)dragDuration));
            inputActionList.Add(item: Input.CreateMouseMoveInput(absoluteX: endPoint.X, absoluteY: endPoint.Y));
            inputActionList.AddRange(collection: Up(button: button, modifierKeys: ModifierKeys.None));
            inputActionList.Add(item: Input.CreateWait(duration: 0));
            this.inputQueue.Process(inputDevice: this.inputDevice, inputList: inputActionList);
            this._location = endPoint;
        }
示例#11
0
        public void ClickDrag(PointerButtons button, UIObject uiObject)
        {
            Validate.ArgumentNotNull(parameter: uiObject, parameterName: nameof(uiObject));
            var num1 = (int)ActionHandler.Invoke(sender: this, actionInfo: ActionEventArgs.GetDefault(action: "WaitForReady"));
            var num2 = (int)ActionHandler.Invoke(sender: this, actionInfo: ActionEventArgs.GetDefault(action: "MakeVisible"));

            if (ActionHandler.Invoke(sender: this, actionInfo: new ActionEventArgs(action: nameof(ClickDrag), button, (object)uiObject)) != ActionResult.Unhandled)
            {
                return;
            }
            PointerInput.ClickDrag(targetObject: this, destinationObject: uiObject, button: button);
        }
示例#12
0
        internal static IInputAction CreateMouseUpInput(PointerButtons button, bool swapped)
        {
            var physicalButton   = DeterminePhysicalButton(button: button, swapped: swapped);
            var mouseInputAction = new MouseInputAction();

            mouseInputAction.mouseInput.flags = MouseButtonsToMouseInputs(physicalButton: physicalButton, isMouseFlagsDown: false);
            if ((button & PointerButtons.XButton1) != PointerButtons.None)
            {
                mouseInputAction.mouseInput.mouseData |= 1U;
            }
            if ((button & PointerButtons.XButton2) != PointerButtons.None)
            {
                mouseInputAction.mouseInput.mouseData |= 2U;
            }
            return(mouseInputAction);
        }
示例#13
0
        static RIMNativeMethods.MOUSE_EVENT_FLAGS MouseButtonsToMouseInputs(
            PointerButtons physicalButton,
            bool isMouseFlagsDown)
        {
            var mouseEventFlags = RIMNativeMethods.MOUSE_EVENT_FLAGS.NONE;

            if (isMouseFlagsDown)
            {
                if ((physicalButton & PointerButtons.PhysicalLeft) != PointerButtons.None)
                {
                    mouseEventFlags |= RIMNativeMethods.MOUSE_EVENT_FLAGS.LEFTDOWN;
                }
                if ((physicalButton & PointerButtons.PhysicalRight) != PointerButtons.None)
                {
                    mouseEventFlags |= RIMNativeMethods.MOUSE_EVENT_FLAGS.RIGHTDOWN;
                }
                if ((physicalButton & PointerButtons.Middle) != PointerButtons.None)
                {
                    mouseEventFlags |= RIMNativeMethods.MOUSE_EVENT_FLAGS.MIDDLEDOWN;
                }
                if ((physicalButton & PointerButtons.XButton1) != PointerButtons.None || (physicalButton & PointerButtons.XButton2) != PointerButtons.None)
                {
                    mouseEventFlags |= RIMNativeMethods.MOUSE_EVENT_FLAGS.XDOWN;
                }
            }
            else
            {
                if ((physicalButton & PointerButtons.PhysicalLeft) != PointerButtons.None)
                {
                    mouseEventFlags |= RIMNativeMethods.MOUSE_EVENT_FLAGS.LEFTUP;
                }
                if ((physicalButton & PointerButtons.PhysicalRight) != PointerButtons.None)
                {
                    mouseEventFlags |= RIMNativeMethods.MOUSE_EVENT_FLAGS.RIGHTUP;
                }
                if ((physicalButton & PointerButtons.Middle) != PointerButtons.None)
                {
                    mouseEventFlags |= RIMNativeMethods.MOUSE_EVENT_FLAGS.MIDDLEUP;
                }
                if ((physicalButton & PointerButtons.XButton1) != PointerButtons.None || (physicalButton & PointerButtons.XButton2) != PointerButtons.None)
                {
                    mouseEventFlags |= RIMNativeMethods.MOUSE_EVENT_FLAGS.XUP;
                }
            }

            return(mouseEventFlags != RIMNativeMethods.MOUSE_EVENT_FLAGS.NONE ? mouseEventFlags : throw new ArgumentException(message: StringResource.Get(id: "InvalidMouseButtonEnum"), paramName: "mouseInputs"));
        }
示例#14
0
        static PointerButtons DeterminePhysicalButton(
            PointerButtons button,
            bool swapped)
        {
            if ((button & PointerButtons.Primary) != PointerButtons.None)
            {
                button &= ~PointerButtons.Primary;
                button  = swapped ? button | PointerButtons.PhysicalRight : button | PointerButtons.PhysicalLeft;
            }

            if ((button & PointerButtons.Secondary) != PointerButtons.None)
            {
                button &= ~PointerButtons.Secondary;
                button  = swapped ? button | PointerButtons.PhysicalLeft : button | PointerButtons.PhysicalRight;
            }

            return(button);
        }
示例#15
0
        public virtual void Click(PointerButtons button, int count)
        {
            if (0 >= count)
            {
                throw new ArgumentOutOfRangeException(paramName: nameof(count), actualValue: count, message: "count should be a positive value");
            }
            var location        = Location;
            var inputActionList = new List <IInputAction>();

            inputActionList.AddRange(collection: Input.PreventAccidentalDoubleClick(x: location.X, y: location.Y, previousRuntimeId: ref this._previousRuntimeId));
            for (var index = 0; index < count; ++index)
            {
                if (index > 0)
                {
                    inputActionList.Add(item: Input.CreateWait(duration: (int)InputManager.DefaultTapDelta));
                }
                inputActionList.AddRange(collection: Down(button: button, modifierKeys: ModifierKeys.None));
                inputActionList.Add(item: Input.CreateWait(duration: (int)InputManager.DefaultPressDuration));
                inputActionList.AddRange(collection: Up(button: button, modifierKeys: ModifierKeys.None));
            }

            inputActionList.Add(item: Input.CreateWait(duration: 100));
            this.inputQueue.Process(inputDevice: this.inputDevice, inputList: inputActionList);
        }
示例#16
0
 public static void DoubleClick(UIObject uiObject, PointerButtons button)
 {
     ClickImplementation(uiObject: uiObject, button: button, numClicks: 2U);
 }
示例#17
0
 public static void Release(PointerButtons button)
 {
     Current.Release(button: button);
 }
示例#18
0
 public static void Press(PointerButtons button)
 {
     Current.Press(button: button);
 }
示例#19
0
 public static void ClickDrag(PointI endPoint, PointerButtons button, uint dragDuration)
 {
     Current.ClickDrag(endPoint: endPoint, button: button, dragDuration: dragDuration);
 }
示例#20
0
 public static void Click(PointerButtons button, int count)
 {
     Current.Click(button: button, count: count);
 }
示例#21
0
 public void Click(PointerButtons button, int count)
 {
     this._inputManager.InjectPress(point: Location, holdDuration: InputManager.DefaultPressDuration, tapCount: (uint)count, tapDelta: InputManager.DefaultTapDelta, packetDelta: InputManager.DefaultPacketDelta);
 }
示例#22
0
 public void Release(PointerButtons button)
 {
     this._inputManager.InjectDynamicRelease(touchPoint: Location, contactId: this.DefaultContactId);
 }
示例#23
0
 public void ClickDrag(PointI endPoint, PointerButtons button, uint dragDuration)
 {
     PressAndDrag(endPoint: endPoint, dragDuration: dragDuration);
 }