XSENDEXTENSIONEVENT(3)
๐ XSENDEXTENSIONEVENT ๐
okay bestie, welcome to the XSENDEXTENSIONEVENT page โ that's section 3 of the manual, aka the library-functions zone, and today we're learning how to yeet input extension events at a client ๐ฆโจ
๐ธ NAME ๐ธ
XSendExtensionEvent โ send input extension events to a client ๐
โจ SYNOPSIS โจ
#include <X11/extensions/XInput.h>
Status XSendExtensionEvent( Display *display,
XDevice *device,
Window destination,
Bool propagate,
int event_count,
XEventClass *event_list,
XEvent *event_send);
๐ the arguments (read them, i'm begging) ๐
displayโ the connection to the X server. your lil phone line to the server, basically ๐deviceโ which device the events are coming from, bestie ๐ฎdestinationโ the window the event is getting sent to. you can pass a window id,PointerWindow, orInputFocus๐ชpropagateโ a Boolean value, so eitherTrueorFalse๐ซถevent_countโ how manyXEventClasses are chillin' inevent_list๐ขevent_listโ the list of event selections we're working with ๐event_sendโ a pointer to the event that's getting sent ๐จ
๐ DESCRIPTION ๐
The XSendExtensionEvent request figures out the destination window, decides which clients should get the specified events, and ignores any active grabs. periodt, no grabs allowed.
This request requires you to pass an event class list. For a discussion of the valid event class names, see XOpenDevice(3). This request uses the w argument to identify the destination window, like so:
- If
wisPointerWindow, the destination window is the window that contains the pointer ๐ฑ๏ธ - If
wisInputFocusand the focus window contains the pointer, the destination window is the window that contains the pointer; otherwise, the destination window is the focus window ๐ฏ
To determine which clients should receive the specified events, XSendExtensionEvent uses the propagate argument as follows:
- If
event_listis the empty set, the event is sent to the client that created the destination window. If that client no longer exists, no event is sent. (rip, the client ghosted ๐ญ) - If
propagateisFalse, the event is sent to every client selecting ondestinationany of the event types specified by theevent_listarray. - If
propagateisTrueand no clients have selected ondestinationany of the events specified by theevent_listarray, the destination is replaced with the closest ancestor ofdestinationfor which some client has selected a type specified by the event-list array and for which no intervening window has that type in its do-not-propagate-mask. If no such window exists, or if the window is an ancestor of the focus window andInputFocuswas originally specified as the destination, the event is not sent to any clients. Otherwise, the event is reported to every client selecting on the final destination any of the events specified in theevent_listarray.
okay so the event in theXEventstructure must be one of the events defined by the input extension (or aBadValueerror results) so that the X server can correctly byte-swap the contents as necessary. no cap, pick a real one.
The contents of the event are otherwise unaltered and unchecked by the X server โ except to force send_event to True in the forwarded event and to set the serial number in the event correctly. that's it, that's the whole glow-up the server gives it โจ
XSendExtensionEvent returns zero if the conversion to wire protocol format failed, and returns nonzero otherwise. XSendExtensionEvent can generate BadClass, BadDevice, BadValue, and BadWindow errors. ๐
๐จ DIAGNOSTICS ๐จ
BadDeviceโ an invalid device was specified. The specified device does not exist or has not been opened by this client viaXOpenInputDevice. This error may also occur if the specified device is the X keyboard or X pointer device. (the X keyboard and X pointer are lowkey off-limits ๐)BadValueโ some numeric value falls outside the range of values accepted by the request. Unless a specific range is specified for an argument, the full range defined by the argument's type is accepted. Any argument defined as a set of alternatives can generate this error. ๐ขBadWindowโ a value for aWindowargument does not name a defined window. (that window does not exist, bestie ๐)
and that's the whole page, you ate it ๐ โจ go forth and send some extension events, you absolute icon ๐ซถ
this diva of a manpage is brought to you by the XSendExtensionEvent(3) crew, dated 05/18/2026 โ remember the date, it's giving historic โญ๐
๐ฆ where this page comes from
- fedora 44: libXi-devel 1.8.3-1.fc44 ยท MIT-open-group AND SMLNJ AND MIT
- fedora 44: libXi-devel 1.8.3-1.fc44 ยท MIT-open-group AND SMLNJ AND MIT
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms