XSELECTEXTENSIONEVEN(3)
π XSELECTEXTENSIONEVEN(3) π
okay bestie, welcome to the XSELECTEXTENSIONEVEN(3) page, aka the manual for XSelectExtensionEvent and XGetSelectedExtensionEvents β yes it's the X Input extension, yes it's giving old-school X11, and yes we're gonna get through it together π«Ά
NAME
XSelectExtensionEvent, XGetSelectedExtensionEvents β select extension events, get the list of currently selected extension events. that's it, that's the whole vibe β¨
π SYNOPSIS π
first things first, you gotta pull in the header, no skipping:
#include <X11/extensions/XInput.h>
then the two functions, looking all main-character:
XSelectExtensionEvent( Display *display,
Window w,
XEventClass *event_list,
int event_count);
XGetSelectedExtensionEvents( Display *display,
Window w,
int *this_client_event_count_return,
XEventClass **this_client_event_list_return,
int *all_clients_event_count_return,
XEventClass **all_clients_event_list_return);
π the args, explained π
displayβ the connection to the X server. your link to the mothership fr fr πwβ the window whose events you are interested in. the one you're obsessed with, basically πevent_listβ the list of event classes that describe the events you are interested in. like your saved-for-later, but for events β¨event_countβ the count of event classes in the event list. math time, but make it cute πthis_client_event_count_returnβ returns the count of event classes selected by this client. that's you, bestie πthis_client_event_list_returnβ returns a pointer to the list of event classes selected by this client. pointer, so you betterXFreeit later, iykyk πall_clients_event_count_returnβ returns the count of event classes selected by all clients. the whole group chat πΈall_clients_event_list_returnβ returns a pointer to the list of event classes selected by all clients. again, pointer, again, free it π
β¨ DESCRIPTION β¨
the XSelectExtensionEvent request causes the X server to report the events associated with the specified list of event classes. initially, X will not report any of these events β no cap, you have to ask. events are reported relative to a window. if a window is not interested in a device event, it usually propagates to the closest ancestor that is interested, unless the do_not_propagate mask prohibits it. so like, the event goes looking for someone who cares, and if the mask blocks it, it just... doesn't π¦
multiple clients can select for the same events on the same window, but with these restrictions, bestie, listen up:
- multiple clients can select events on the same window because their event masks are disjoint. when the X server generates an event, it reports it to all interested clients. sharing is caring π
- only one client at a time can select a
DeviceButtonPressevent with automatic passive grabbing enabled, which is associated with the event classDeviceButtonPressGrab. to receiveDeviceButtonPressevents without automatic passive grabbing, use event classDeviceButtonPressbut do not specify event classDeviceButtonPressGrab. one at a time, bestie, no fighting π
the server reports the event to all interested clients. periodt.
information contained in the XDevice structure returned by XOpenDevice is used by macros to obtain the event classes that clients use in making XSelectExtensionEvent requests. currently defined macros include DeviceKeyPress, DeviceKeyRelease, DeviceButtonPress, DeviceButtonRelease, DeviceMotionNotify, DeviceFocusIn, DeviceFocusOut, ProximityIn, ProximityOut, DeviceStateNotify, DeviceMappingNotify, ChangeDeviceNotify, DevicePointerMotionHint, DeviceButton1Motion, DeviceButton2Motion, DeviceButton3Motion, DeviceButton4Motion, DeviceButton5Motion, DeviceButtonMotion, DeviceOwnerGrabButton, DeviceButtonPressGrab, and NoExtensionEvent. iconic lineup honestly π
to obtain the proper event class for a particular device, one of the above macros is invoked using the XDevice structure for that device. for example:
DeviceKeyPress (*device, type, eventclass);
this returns the DeviceKeyPress event type and the eventclass for selecting DeviceKeyPress events from this device. slay π
XSelectExtensionEvent can generate a BadWindow or BadClass error. noted. π¨
the XGetSelectedExtensionEvents request reports the extension events selected by this client and all clients for the specified window. this request returns pointers to two XEventClass arrays. one lists the input extension events selected by this client from the specified window. the other lists the event classes selected by all clients from the specified window. you should use XFree to free these two arrays. do not forget this β memory leaks are not the vibe π
XGetSelectedExtensionEvents can generate a BadWindow error.
π DIAGNOSTICS π
BadWindowβ a value for aWindowargument does not name a defined window. that window does not exist, bestie, she's not real πΈBadClassβ a value for anXEventClassis invalid. wrong class, wrong energy, rejected π
and that's the whole page, you ate it π this was XSELECTEXTENSIONEVEN(3) from the X11 manual, dated 05/18/2026 β go forth and select those extension events, bestie, you've got this π¦β¨
π¦ 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