Click the wheel button (click middle button)
Power Automate Desktop has many actions that submit operations that users perform through her IO device, such as keyboards and mice.
However, there are so many actions that can be used, so it is often difficult to find the purpose of the purpose.
This time, I will explain how to reproduce the operation of pushing the wheels between right -clicks and left -clicks, called wheel buttons, middle buttons, middle clicks, etc.
Details of "Mouse click transmission" action
This time, we use an action called "Send Mouse Click".
The action has the following parameters.
Parameter name | value |
---|---|
Mouse event to send | Which mouse event to operate (click medium this time) |
delay | Waiting time until the event is executed (milliseconds) |
Moving mouse | After checking, the event will be executed after moving to the specified coordinates. |
X | Moving X coordinates (horizontal direction) |
Y | Moving Y coordinates (vertical direction) |
screen | Select whether the coordinates are based on the entire screen or the relative coordinates of the front window |
Mouse movement style | Select the speed to move the orbit up to the target coordinates |
implemented with copy and paste
This time, as a sample, we have prepared a flow to specify the relative coordinates from the active window and send the middle click.
Copy the following code and paste it on the edit screen of Power Automate Desktop to add the target action.
MouseAndKeyboard.SendMouseClick.ClickAt ClickType: MouseAndKeyboard.MouseClickType.MiddleClick MillisecondsDelay: 0 X: 100 Y: 200 RelativeTo: MouseAndKeyboard.PositionRelativeTo.ActiveWindow MovementStyle: MouseAndKeyboard.MovementStyle.Instant
ON ERROR REPEAT 3 TIMES WAIT 1
ON ERROR
END
Power Automate Desktop is implemented
Enter "Mouse click transmission" from "Action Search".
Set the parameter as follows
Parameter name value Mouse event to send Middle click delay 0 Moving mouse check X 100 Y 200 screen Active window Mouse movement style straight away By execution, you will send a medium click to the coordinates specified in the active window.
The exception that can occur
If the click coordinates are specified so that they are outside the screen, an error will be made.In addition, clicks may not be sent for other reasons and may cause an error.
We recommend that you implement block processing.