Monitor Switching Between 3 Displays with Cursor

PROBLEM:
I have a three-monitor system: a main widescreen monitor in the center hovering above my macbook pro and a 4:3 monitor to the left of my macbook pro. I want to create a macro that cycles the cursor to the center of each monitor consequently within this order. I’ve also included the coordinates for each monitor resolution for more granularity.

• Center of left display (4:3 Monitor) 1600x1000
• Center of center display (Widescreen Monitor) 2560x1440
• Center of right display (Macbook Internal Display) 1728x1117

To clarify, I’m only focused on moving the the cursor position moving to a specific display and nothing pertaining to specific apps or windows. Thanks in advance

Your screens are (probably, assuming they're top-aligned!) indexed as follows:

Left display -- index 1
Centre display -- index 2
Right display - index 3

...and you can get screen information with either the SCREEN() or SCREENVISIBLE() functions or the equivalent text tokens.

  • You can get the index of screen the mouse is currently on with SCREEN(Mouse)
  • The next screen index will be one more than the current unless you are on screen 3, in which case it will be 1
  • You can get the absolute centre coordinates of a screen with SCREEN(index, MidX) and SCREEN(index, MidY)
  • You can use those values in a "Move or Click Mouse" Action

This is a fun little problem that, with the help of KM's documentation, will quickly get you up to speed with many KM basics -- so have a go at putting the above together in a macro that'll do what you want. If you get stuck then post your macro (instructions here) and ask questions.

2 Likes