XkbQueryExtension(3)
β¨ XkbQueryExtension(3) β¨
okay so bestie, this one is from the XKB FUNCTIONS section of the manual and it's literally your vibe check for the X Keyboard Extension π₯ like it's the thing you call to find out if the server even has a compatible Xkb and then it sets it up for you. icon behavior.
π NAME π
XkbQueryExtension β determines the compatibility of a library at runtime π«Ά
πΈ SYNOPSIS πΈ
Bool XkbQueryExtension (Display *dpy, int *opcode_rtrn, int *event_rtrn,
int *error_rtrn, int *major_in_out, int *minor_in_out);
π ARGUMENTS π
dpyβ your connection to the X server, the whole group chat basicallyopcode_rtrnβ gets backfilled with the major extension opcodeevent_rtrnβ gets backfilled with the extension base event codeerror_rtrnβ gets backfilled with the extension base error codemajor_in_outβ you put in the compile time lib major version, server major version comes out πminor_in_outβ compile time lib min version in, server minor version out β¨
π¦ DESCRIPTION π¦
Call XkbQueryExtension to check whether the extension is present and compatible in the server, and to initialize the extension. this is the main character call π
and like, because version mismatches are a whole thing? you literally cannot use the generic extension mechanism functions (XQueryExtension and XInitExtension) for checking for the presence of, and initializing the Xkb extension. no cap, they're not it for this. π
the rule, bestie: you must callXkbQueryExtensionorXkbOpenDisplaybefore using any other Xkb library interfaces β unless such usage is explicitly allowed in the interface description in this document. periodt.
the exceptions are: XkbIgnoreExtension, XkbLibraryVersion, and a handful of audible-bell functions π. and you should not use any other Xkb functions if the extension is not present or is uninitialized. in general, calls to Xkb library functions made prior to initializing the Xkb extension cause BadAccess protocol errors π so like, don't do that.
so what does it actually do? XkbQueryExtension both determines whether a compatible Xkb extension is present in the X server and initializes the extension when it is present. two for one, slay. π«Ά
specifically: the XkbQueryExtension function determines whether a compatible version of the X Keyboard Extension is present in the server. if a compatible extension is present, XkbQueryExtension returns True; otherwise, it returns False.
if a compatible version of Xkb is present, XkbQueryExtension initializes the extension. it backfills:
- the major opcode for the keyboard extension in
opcode_rtrn - the base event code in
event_rtrn - the base error code in
error_rtrn - the major and minor version numbers of the extension in
major_in_outandminor_in_out
the major opcode is reported in the req_major fields of some Xkb events π― for a discussion of the base event code.
π RETURN VALUES π
Trueβ theXkbQueryExtensionfunction returnsTrueif it determines a compatible version of the X Keyboard Extension is present in the server πFalseβ theXkbQueryExtensionfunction returnsFalseif it determines a compatible version of the X Keyboard Extension is not present in the server π
π SEE ALSO π
and that's the whole vibe check bestie, go forth and initialize π
this page is from X Version 11, libX11 1.8.14 β mwah, kisses from the XKB FUNCTIONS section πβ¨
π¦ 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
- Copyright (c) 1999, Oracle and/or its affiliates
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms