How to press and hold LeftClick/ multiple LeftClick for xclick

I have been searching for an hour but I could not figure out how to ask xclick to press and hold, or xclick repeatedly 40times instead of running xclick&wait then xclick&wait then xclick&wait.

For example: using UI vision (browser automation mode) to automate the Android phone task (through ws-scrcpy software), I want to simulate “click and hold” a position in Andoird phone by using xclick. It works for xclick one-click (or double click triple click) but not click&hold or multiple 40-times clicks. I was looking for a way to change the runtime or click time variable, but there is no option to change if for only 1 line.

I would appreciate any feedback.

Hi, did you try these methods yet? They should work:

Click and hold:

  • XMove | (image) | #down
  • XMove | (image) | #up

Click 40 times:

  • times | 40
  • XClick | (image)
  • end

Thank you @Plankton for your instructions. Unfortunately, I still could not do it and I uploaded the videos below (using Firefox). I am using Actiona at the moment, but I am still interested in learning UI.Vision.

XClick: I tried to simulate click number 9 for 5 times on the online calculator but the “times” command does not work. XClick_5_times_unsuccessful.mp4 - pCloud

XMove: I tried to simulate draw a line from A to B (which is click&hold from A to B) on autodraw . com but the XMove identified the A & B but not click it. XMove_unsuccesful.mp4 - pCloud

The vidoes are helpful to see what goes wrong:

XClick: you used the TIMES command wrong. The XClick must be between TIMES and END.

Drag & Drop: The #down and #up parameters are missing. Without it, the XMOVE command just moves the mouse, but never clicks it.

  • XMove | (image) | #down - press mouse button and keep it pressed.
  • XMove | (another image) | move to new location
  • XMove | ${!imagex},${!imagey} | #up release mouse button again

See here:How to click and drag in RPA - #4 by Tim

1 Like

Thank you very much @ulrich. Yes, it worked!