If dest_w is None, XWarpPointer moves the pointer by the offsets
(dest_x, dest_y) relative to the current position of the pointer. If
dest_w is a window, XWarpPointer moves the pointer to the offsets
(dest_x, dest_y) relative to the origin of dest_w. However, if src_w
is a window, the move only takes place if the window src_w contains the
pointer and if the specified rectangle of src_w contains the pointer.
xdotool可以这样做:
窗口 id可以是 X11 窗口 id 或对先前 xdotool 窗口选择命令结果的引用;有关详细信息,请参见手册页。
你试过 XWarpPointer 吗?手册页说:
它不是一个独立的实用程序,而是一个 Xlib 函数;您应该能够通过 Python Xlib 绑定来使用它。