DEV Community

Yaoxing Zhang
Yaoxing Zhang

Posted on

Created a Mouse Mover for Mac

Repository: https://github.com/zhangyaoxing/toolkit
Not sure how many of you have the same problem. I found moving mouse cursor/windows across multiple monitors wastes a lot of time. Especially when you like me who use a touch pad instead of a mouse. So I came up with the idea of creating a tool to help myself move the cursor/window to specified monitors using keyboard shortcut. This will be very helpful when you need to constantly switch between screens, or moving windows into the screen that you are sharing in a meeting. With this tool, I can

  • Bind a shortcut to all monitors.
  • Once the shortcut is pressed, the mouse will be moved to the center of the specified monitor and show a highlight effect.
  • If you are dragging the window, the window will also be moved to the target monitor.
  • You can also set shortcut to move the currently active window to the target monitor.

There are some technical details that I made to make the user experience better.

  • If the window is maximized (or almost maximized), and you use the shortcut to move the window, the window will be maximized in the target monitor too. This is due to screen resolution difference, the size of window may look different in different monitors.
  • If the window is not maximized, it will convert the coordinates so that the window will show up at the same position of the target monitor.

I'm not a professional Swift developer so this tool is mostly done by AI. Feel free to fork or submit pull requests.

Top comments (0)