XKeymapEvent(3)
π NAME π
okay so this is the page for XKeymapEvent(3), straight out of the XLIB FUNCTIONS manual, bestie β it's literally the KeymapNotify event structure. That's the name section, periodt. β¨
π¦ STRUCTURES π¦
The structure for KeymapNotify events contains:
/* generated on EnterWindow and FocusIn when KeymapState selected */
typedef struct {
int type; /* KeymapNotify */
unsigned long serial; /* # of last request processed by server */
Bool send_event; /* true if this came from a SendEvent request */
Display *display; /* Display the event was read from */
Window window;
char key_vector[32];
} XKeymapEvent;
When you receive this event, the structure members are set as follows. No cap, this is the vibe check for every member. π
typeβ set to the event type constant name that uniquely identifies it. For example, when the X server reports aGraphicsExposeevent to a client application, it sends anXGraphicsExposeEventstructure with thetypemember set toGraphicsExpose. Iconic example behavior, honestly.displayβ set to a pointer to the display the event was read on. π«Άsend_eventβ set toTrueif the event came from aSendEventprotocol request. πserialβ set from the serial number reported in the protocol, but expanded from the 16-bit least-significant bits to a full 32-bit value. Math girlie moment.windowβ set to the window that is most useful to toolkit dispatchers. π
Then there's the window member again, because she's a little extra: window is not used but is present to aid some toolkits. Not me explaining the same member twice, but the manpage said it, so we're saying it. π
The key_vector member is set to the bit vector of the keyboard. Each bit set to 1 indicates that the corresponding key is currently pressed. The vector is represented as 32 bytes. Byte N (from 0) contains the bits for keys 8N to 8N + 7 with the least significant bit in the byte representing key 8N. That's the whole mapping, bestie β byte N, keys 8N through 8N + 7, LSB = key 8N. Slay. π₯
π SEE ALSO π
XAnyEvent(3),XButtonEvent(3),XCreateWindowEvent(3),XCirculateEvent(3),XCirculateRequestEvent(3),XColormapEvent(3),XConfigureEvent(3),XConfigureRequestEvent(3),XCrossingEvent(3),XDestroyWindowEvent(3),XErrorEvent(3),XExposeEvent(3),XFocusChangeEvent(3),XGraphicsExposeEvent(3),XGravityEvent(3),XMapEvent(3),XMapRequestEvent(3),XPropertyEvent(3),XReparentEvent(3),XResizeRequestEvent(3),XSelectionClearEvent(3),XSelectionEvent(3),XSelectionRequestEvent(3),XUnmapEvent(3),XVisibilityEvent(3)Xlib - C Language X Interface
byeee π«Ά this page's footer energy is literally X Version 11, libX11 1.8.14, and XKeymapEvent(3) β mwah, bestie. πβ¨
π¦ where this page comes from
- alpine 3.24: libx11-doc 1.8.14-r0 Β· X11
- arch rolling: libx11 1.8.14-1 Β· MIT AND X11
- nixos 26.05: libx11 1.8.14
- nixpkgs unstable: libx11 1.8.14
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms