【发布时间】:2020-01-06 15:00:13
【问题描述】:
我使用here 概述的xinput 命令创建了一个假鼠标指针,它会产生一个悬停在我屏幕中心的第二个指针。
我现在想使用xte 命令将其自动化,但不幸的是xte 似乎只能控制我希望保持空闲的硬件鼠标。
xte 的手册页没有任何标志来指定要控制哪个指针。
我想知道是否有人有任何想法?
注意:第二个指针纯粹是为了让我能够在运行图形管道的同时在同一台计算机上工作
编辑:所以通过查看 xte 源,我发现了对 XQueryPointer 的引用
Bool XQueryPointer(display, w, root_return, child_return, root_x_return, root_y_return,
win_x_return, win_y_return, mask_return)
Display *display;
Window w;
Window *root_return, *child_return;
int *root_x_return, *root_y_return;
int *win_x_return, *win_y_return;
unsigned int *mask_return;
//Arguments:
display Specifies the connection to the X server.
w Specifies the window.
root_return Returns the root window that the pointer is in.
child_return Returns the child window that the pointer is located in, if any.
root_x_return
root_y_return Return the pointer coordinates relative to the root window's origin.
win_x_return
win_y_return Return the pointer coordinates relative to the specified window.
mask_return Returns the current state of the modifier keys and pointer buttons.
来自 Xlib 类,如您所见,它只返回第一个鼠标指针,不提供另一个选项。
Edit2:查看 libx11-dev 源代码,我发现在 ./src/QuPntr.c 和 Xlibint.h 中提到了它,但代码越来越难以阅读,我在这里超出了我的深度
【问题讨论】: