cliclick icon indicating copy to clipboard operation
cliclick copied to clipboard

Restore (-r) does not work with `cliclick -r m:100,100`

Open tobiashochguertel opened this issue 3 years ago • 9 comments

I tried to move the mouse to the place 100,100 and then restore the previous position (-r), but the mouse stays at 100,100 and is not restored.

watch -n 5 cliclick -r m:100,100

or 

cliclick -r m:100,100

I try to prevent enabling the screensaver - which is at the moment managed by my company and is activated each 5 minutes when there was no activity. But this usage doesn't matter - I think we just have a bug in cliclick ;)

$ sw_vers
ProductName:	macOS
ProductVersion:	11.0.1
BuildVersion:	        20B50
1 hochguertelto@de-dus-nb-toh:~
$ cliclick -h

cliclick (short for “Command Line Interface Click”) is a tool for executing mouse- and keyboard-related actions from the shell/Terminal

USAGE
  cliclick [-r] [-m <mode>] [-d <target>] [-e <num>] [-f <file>] [-w <num>] command1 [command2]

OPTIONS
  -r          Restore initial mouse location when finished

....

Version 4.0.1, released 2018-04-10
Author: Carsten Blüm, <[email protected]>
List of contributors: https://github.com/BlueM/cliclick/graphs/contributors
Website: https://www.bluem.net/jump/cliclick/

tobiashochguertel avatar Dec 08 '20 21:12 tobiashochguertel

Okay a workaround is:

watch -n 250 "cliclick m:+50,+0 m:-50,0"

moves the cursor each 250 seconds relative from his current position "50 pixel to the left", and then "50 pixel to the right".

That works, very well!

Life safer, so I can read without thinking documentations or watch a movie. 😃

But the bug "-r" is still present ;)

tobiashochguertel avatar Dec 09 '20 18:12 tobiashochguertel

I’m still on 10.15 (notorious late adopter) and can’t reproduce the problem – -r works as expected.

What happens when you try to use cliclick p? Do you get the correct current cursor coordinates?

BlueM avatar Jan 09 '21 17:01 BlueM

I too have the same issue, cliclick p does work it gives the right mouse position but when I do

cliclick -r m:0,0

(to activate hot corner) it doesn't do anything, I'm on big sur 11.6

cliclick m:0,0 

works fine

nadeemkhedr avatar Sep 29 '21 19:09 nadeemkhedr

@tobiashochguertel: Do you use more than one screen?

@nadeemkhedr: “doesn't do anything” means the hot corner action is not triggered?

BlueM avatar Oct 18 '21 19:10 BlueM

@BlueM yes it doesn't trigger

nadeemkhedr avatar Oct 18 '21 19:10 nadeemkhedr

@tobiashochguertel: Do you use more than one screen?

@nadeemkhedr: “doesn't do anything” means the hot corner action is not triggered?

Yes, I have double screen, and sometimes triple screen. I think when I reported this issue, I had double screen.

tobiashochguertel avatar Oct 18 '21 20:10 tobiashochguertel

@tobiashochguertel: As you (probably) used two screens and the cliclick version was < 5.0.1, I’d assume it’s #119. Please try if the problem is reproducible with 5.0.1

@nadeemkhedr: it seems that to activate hot corners, you need to slow down / humanize the mouse movement. I found that in my case, cliclick -e 100 m:0,1440 (for lower left corner) works. But: depending on the hot corner action, macOS might require the mouse to stay there for some seconds. So, when used with -r, it might be necessary to add the “wait” (w) action: cliclick -r -e 100 m:0,1440 w:2000.

BlueM avatar Nov 28 '21 07:11 BlueM

I'm new here and on 12.1. The cliclick m:0,0 doesn't move the mouse to 0,0, it just stays at the current position in the terminal window. Is there something that I'm missing w.r.t. 12.1?

dkbarto avatar Dec 20 '21 15:12 dkbarto

@dkbarto: that’s a different issue, probably https://github.com/BlueM/cliclick/issues/135#issuecomment-999397195

BlueM avatar Dec 22 '21 08:12 BlueM