Automatically move mouse pointer to default button on dialog box
No, there is not.
Fundamental to macOS is the design principle that only the user moves the pointer, which is one's tool to manipulate items in the interface. This approach gives the user full control over the pointer, physically and cognitively. Were it to move unpredictably and unrelated to the movement made by the user, it would result in confusion and cognitive dissonance, such as:
- where did the pointer go? I was just looking at it and it disappeared
- I was about to click on something over here, but when I did so a button on a different part of the screen got clicked
This is so fundamental in fact, that I can't find a specific reference to it in Apple's documentation. Maybe it is not explicitly discussed since Apple set the standard through its API and it is accepted as a given now after nearly 40 years. The most relevant references I can find are ones like these from Inside Macintosh (1985):
…the user's actions tend to have direct results … The user, not the system, decides what to do next … they would be confused and irritated if they had to learn a completely new interface for each application …
In general, moving the mouse changes nothing except the location, and possibly the shape, of the pointer.
So, left implied by Apple's human interface guidelines — and enforced by the API — is that the pointer should only be moved when the user interacts intentionally with the mouse/trackpad/pointing device.
Now, this begs the question, why do you want this behavior?
- If you are a programmer, I would strongly urge avoiding doing this in your applications for the reasons above.
- If you want it for yourself, what is your goal, that you can more easily target the default button in dialog boxes? If so, I would call your attention to the fact that the primary (default) button is given the system's highlight color (by default a blue background) and will respond to a press of the Return key. Note the examples in Apple's current Human Interface Guidelines at Dialogs. (Also note that if you have System Preferences ▶ Keyboard ▶ Shortcuts ▶ Use keyboard navigation… turned on, you can use Tab / Shift+Tab to change what button is selected and Space to activate it.)
So perhaps you can come to appreciate the predictability of the Mac pointer not jumping around — especially since as a longtime Windows user, it should be comforting to know keyboard shortcuts can be your fastest approach to confirming dialogs. 🙂