Just move mouse cursor?
Here is a simple one where I might look stupid for just asking...
Is there any way to just move the mouse cursor to a specific location? I don't want to click or anything. But in classic sound, editor fashion, I want to do the least mouse movement possible. I have three screens and would love to be able to press a hot key and immediately jump from the middle of my far-left screen to far-right screen, etc, and immediately start working from there.
All of the mouse position, actions that I'm seeing are getting coordinates, or clicks, but don't actually move me there and return the mouse to where I was. Am I missing something?
- In reply toMason_Kopeikin⬆:Chris Shaw @Chris_Shaw2025-01-24 22:40:20.520Z2025-01-24 23:09:45.849Z
This script will store your current mouse position and then move it to the center of your desired screen. Set the screen you want to move to in the first line of the script. Make a copy of the script for each screen you want to move to.
When you run the script a second time, it will see if there's a stored mouse position and if there is it will return the mouse to the previous position. It doesn't matter which version of the script you use, if there's a stored position it will restore it. Running it again after a restore will move the cursor to the desired screen.
const targetScreenNumber = 2 if (globalState.csMouseMoveOrigPosition) { sf.mouse.setPosition({ position: globalState.csMouseMoveOrigPosition }) delete globalState.csMouseMoveOrigPosition } else { const currentMousePosition = sf.mouse.getPosition().position; globalState.csMouseMoveOrigPosition = { x: currentMousePosition.x, y: currentMousePosition.y, } const targetScreenIndex = targetScreenNumber - 1; const targetScreen = sf.ui.screens.allScreens[targetScreenIndex]; sf.mouse.setPosition({ position: { x: targetScreen.frame.x + (targetScreen.frame.w / 2), y: targetScreen.frame.y + (targetScreen.frame.h / 2), } }) }
Kitch Membery @Kitch2025-01-24 22:50:25.751Z
Looks like Chris beat me to it. :-)
- In reply toChris_Shaw⬆:MMason Kopeikin @Mason_Kopeikin
Amazing, thanks Chris!
- In reply toMason_Kopeikin⬆:Kitch Membery @Kitch2025-01-24 22:40:34.068Z
I'm with you on this!!! The fewer manual mouse movements the better!
I'll take a look shortly. :-)