how to move mouse to specific point with keyboard shortcut

38 views Asked by At

I have 2 monitors and on one I keep iTerm and vscode in fullscreen mode. I have shortcut keys via Karabiner to swich between the two. The problem is the other monitor has a few other apps not in full screen so I can monitor them. Like Mail, Spotify, Calendar etc. I would like to be able to hit a shortcut and have my mouse placed on Spotify.

Bonus points if this can be done with multiple Chrome windows pointing to different websites.

1

There are 1 answers

0
IceKowedd On

Well this is possible, you can write it in python.

  • you can make a shortcut that opens python script.
  • or make it run continuously and when certain buttons are pressed move mouse to X and Y

I would recommend pyautogui - pip install pyautogui - https://github.com/asweigart/pyautogui

function - moveTo() - Can move mouse by giving it X and Y coords.