// A scriptable zwlr_virtual_pointer_unstable_v1 driver: reads one command // per line from stdin and turns it into a virtual-pointer request against // whatever compositor WAYLAND_DISPLAY names. // // WHY THIS EXISTS RATHER THAN ydotool // // ydotool writes to /dev/uinput. That is a kernel-level device shared by // every session on the machine, so a synthetic click from it lands wherever // the real seat's focus happens to be - which, when the target is a nested // throwaway compositor, is very often the user's real desktop instead. This // tool is an ordinary Wayland client of one specific compositor, so its // input physically cannot reach any other one. That makes it the safe way // to drive a nested test instance, which is the only reason it exists. // // ../virtual-pointer-pin-test is not this: it is a fixed left-button drag // used to verify pinned delivery, and it blocks on stdin exactly once. This // one stays alive and takes a stream of commands, so a shell script can // interleave a `grim` screenshot between a move and the click that follows // it - which is what "never click at a position you have not verified // first" actually requires. // // Usage: // vpclick (commands on stdin, one per line) // // move absolute, as a fraction of EXTENT (5000 5000 = centre) // press