简体   繁体   中英

Get relative position of mouse in a window in x11

I need to get the relative position of mouse pointer in the window in which it is clicked, i've coded to capture the click event, but when i use this code


result = XQueryPointer(disp, XRootWindow(disp,0),&win, &win, &root_x, &root_y, &win_x, &win_y, &mask_return);

it shows the global position of mouse when printing win_x and win_y

only window i have is "win" the display is "disp"

找出evt.xbutton.x和evt.xbutton.y返回窗口相对鼠标坐标

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM