Skip to main content

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 namevalue
Mouse event to sendWhich mouse event to operate (click medium this time)
delayWaiting time until the event is executed (milliseconds)
Moving mouseAfter checking, the event will be executed after moving to the specified coordinates.
XMoving X coordinates (horizontal direction)
YMoving Y coordinates (vertical direction)
screenSelect whether the coordinates are based on the entire screen or the relative coordinates of the front window
Mouse movement styleSelect the speed to move the orbit up to the target coordinates

action

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

  1. Enter "Mouse click transmission" from "Action Search".

  2. Set the parameter as follows

    Parameter namevalue
    Mouse event to sendMiddle click
    delay0
    Moving mousecheck
    X100
    Y200
    screenActive window
    Mouse movement stylestraight away
  3. 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.