简体   繁体   中英

How to get absolute mouse cursor position in wayland

How does one go about finding the absolute mouse cursor position in wayland (Not X11). For example in windows we use the GetCursorPos() function from windows.h and that will give absolute X,Y positions starting from 0,0.

I'm aware of /dev/input/mice however that is relative and not absolute. The closest thing I came across was setting them, but not getting them.

In Wayland, you need to implement this for each compositor separately (if the compositor implements it at all). The Wayland protocol itself does not provide such feature.

There are also external tools/libraries that should be able to expose such functionality: Wayland Global Pointer Location

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