Win10有没有快捷方式return鼠标指针指向上次点击的位置?

Is there a Win10 shortcut to return the mouse pointer to the last clicked location?

我想知道在 Win10 中是否有办法 return 将鼠标指针指向其上次单击的位置?

期望的行为是:

用户点击鼠标左键。这可以在浏览器中的任何位置 window,它不一定是 UI 元素。 用户使用将鼠标移动到另一个位置。 用户按下快捷键。 鼠标 return 移动到上次单击的位置。

我看过 AHK 脚本 return 鼠标指针指向屏幕上的特定位置,但没有记录点击位置然后 return 使用快捷方式的鼠标指针.

这可以通过使用通配符 (*) 和波浪符 (~) modifiers so that the hotkey will activate even if other keys are being held down, and the hotkey will not suppress the Mouse button's normal functions respectively. This hotkey will capture the current position of the mouse using the MouseGetPos 命令将 LButton(鼠标左键)映射到热键并将 x 和 y 坐标保存到变量中(在本例中, xposypos

接下来,我们可以创建另一个热键(本例中为 Control+q)以使用文档中的 MouseMove command back to the position saved in the variables. To map this to a hotkey of your choice, check out the page on Hotkeys 移动鼠标。


结果代码:

*~LButton::MouseGetPos, xPos, yPos
^q::MouseMove, xPos, yPos