xcb_warp_pointer(3)

πŸ“¦
version 1.17.0 Β· 4 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– xcb_warp_pointer β€” bestie, we're moving the mouse πŸ’–

okay so this is xcb_warp_pointer, and it lives in the XCB Requests corner of the xcb_warp_pointer(3) manual. it does exactly one thing and it does it iconically: it moves the mouse pointer. periodt. πŸ–±οΈβœ¨


✨ NAME ✨

xcb_warp_pointer β€” move mouse pointer πŸ¦‹


✨ SYNOPSIS ✨

#include <xcb/xproto.h>

🌸 Request function 🌸

xcb_void_cookie_t xcb_warp_pointer(xcb_connection_t *conn,
       xcb_window_t src_window, xcb_window_t dst_window, int16_t src_x,
       int16_t src_y, uint16_t src_width, uint16_t src_height,
       int16_t dst_x, int16_t dst_y);

✨ REQUEST ARGUMENTS ✨

  • conn β€” the XCB connection to X11. your whole lil hotline to the server, no cap 🫢
  • src_window β€” if src_window is not XCB_NONE (TODO), the move will only take place if the pointer is inside src_window and within the rectangle specified by (src_x, src_y, src_width, src_height). the rectangle coordinates are relative to src_window. like, the pointer has to already be in the right zone for anything to happen πŸ’…
  • dst_window β€” if dst_window is not XCB_NONE (TODO), the pointer will be moved to the offsets (dst_x, dst_y) relative to dst_window. if dst_window is XCB_NONE (TODO), the pointer will be moved by the offsets (dst_x, dst_y) relative to the current position of the pointer. two completely different vibes depending on which one you pick, choose wisely bestie 😭
  • src_x β€” TODO: NOT YET DOCUMENTED. πŸ’€
  • src_y β€” TODO: NOT YET DOCUMENTED. πŸ’€
  • src_width β€” TODO: NOT YET DOCUMENTED. πŸ’€
  • src_height β€” TODO: NOT YET DOCUMENTED. πŸ’€
  • dst_x β€” TODO: NOT YET DOCUMENTED. πŸ’€
  • dst_y β€” TODO: NOT YET DOCUMENTED. πŸ’€
not the TODO wall 😭 the docs said "we'll get to it" and then never did. it's giving unfinished homework. but hey, the args are all still there, we're not skipping a single one πŸ’–

✨ DESCRIPTION ✨

Moves the mouse pointer to the specified position. that's it. that's the whole thing. main character behaviour honestly πŸ‘‘

If src_window is not XCB_NONE (TODO), the move will only take place if the pointer is inside src_window and within the rectangle specified by (src_x, src_y, src_width, src_height). The rectangle coordinates are relative to src_window.

If dst_window is not XCB_NONE (TODO), the pointer will be moved to the offsets (dst_x, dst_y) relative to dst_window. If dst_window is XCB_NONE (TODO), the pointer will be moved by the offsets (dst_x, dst_y) relative to the current position of the pointer.

so basically: gatekeep the move with src_window, then decide where it lands with dst_window. the way that this function needs you to think about both windows at once... it's a lot but we're built for it 🧚


✨ RETURN VALUE ✨

Returns an xcb_void_cookie_t. Errors (if any) have to be handled in the event loop. πŸ‘€

If you want to handle errors directly with xcb_request_check instead, use xcb_warp_pointer_checked. See xcb-requests(3) for details.

lowkey important: the plain version hands you a cookie and makes you go check the event loop yourself. the _checked one is the "just tell me right now" version. pick your fighter πŸŽ€

✨ ERRORS ✨

  • xcb_window_error_t β€” TODO: reasons? πŸ’€
yeah. that's the whole error section. they really left us on read for this one πŸ™ˆ

✨ SEE ALSO ✨


✨ AUTHOR ✨

Generated from xproto.xml. Contact xcb@lists.freedesktop.org for corrections and improvements. πŸ“§


okay bestie that's the whole page, every flag, every TODO, every number, untouched, fr fr. this one's from X Version 11, libxcb 1.17.0, and it's the xcb_warp_pointer(3) page β€” go forth and warp responsibly, you absolute icon πŸ’…πŸŒΈβœ¨