How to set mouse cursor position in C on linux?

后端 未结 6 1059
礼貌的吻别
礼貌的吻别 2020-12-14 07:52

how can I set the mouse cursor position in an X window using a C program under Linux? thanks :) (like setcursorpos() in WIN)

EDIT: I\'ve tried this

6条回答
  •  一生所求
    2020-12-14 08:36

    You can use XWarpPointer to move the mouse cursor in an X window.

    XWarpPointer(display, src_w, dest_w, src_x, src_y, src_width, src_height, dest_x, 
                    dest_y)
            Display *display;
            Window src_w, dest_w;
            int src_x, src_y;
            unsigned int src_width, src_height;
            int dest_x, dest_y;
    

提交回复
热议问题