I want to duplicate actions performed on my main screen on a second screen i.e. mouse clicks and keyboard input.

I have one iMac, with two similar displays. On both displays, I have opened two same programs with near pixel-perfect identical positions on the screens.

How can I achieve this? Does such a task require a programmer?

As an example:

Let's say, I open the Chrome browser, logged-in with my Google username ,on the main screen. On the screen display attached to my Mac, I open another Chrome browser window, this time logged-in as my friend's Google username.

What I want is for anything I do on the first browser (mouse clicks and keyboard) to be done on the second browser, on the second monitor.

2 Answers
2

Forgetting the secondary display for a second, you can't type or (mouse) control more than one window at a time. It's the window that has focus that accepts input. Think about it...you can move your mouse anywhere across any open windows, but you have to take focus of the window (click or hover depending on your settings) before you can interact with it.

Even moving the mouse in two separate windows is impossible. Your mouse works on a coordinate system (X,Y). You can see what it's (X,Y) value is by pressing CmdShift4 (screen capture). There is no way to have a secondary coordinate value to "mirror" it on another window.

Adding another display won't help, either because unless you are mirroring the display (and since your example used different chrome browser profiles) you would be extending the display and the available (X,Y) coordinate system.

maybe that can achieved mot exact mirroring, but with "trick", lets say, I click at X,Z then program should change mouse position (in milliseconds) to 2nd monitor X,Z and click there, and then return mouse back... is that possible?
– T.ToduaMar 23 '17 at 14:41

Is it possible? Yes. Is it feasible or practical? Doubtful. This workflow that you are describing sounds more like an XY Problem (and not related to the coordinate system)
– AllanMar 23 '17 at 15:15

This may not be answering your exact question, but it might solve what you are trying to do. You could use Automator to record what you do and then run it again, when you are logged in as another user on Google. Just don't record the login part.