XkbGetKeyboard(3)

πŸ’– NAME πŸ’–

okay bestie, welcome to XkbGetKeyboard(3) from the XKB FUNCTIONS section β€” this is the one that retrieves one or more components of a keyboard device description. that's the whole name vibe, periodt. ✨

🌸 SYNOPSIS 🌸

the function signature, exactly as printed:

XkbDescPtr XkbGetKeyboard (Display *display, unsigned int which,
       unsigned int device_spec);

πŸŽ€ ARGUMENTS πŸŽ€

  • display β€” connection to the X server.
  • device_spec β€” device ID, or XkbUseCoreKbd.
  • bits_to_change β€” determines events to be selected / deselected.
  • values_for_bits β€” 1=>select, 0->deselect; for events in bits_to_change.
side note bestie: the SYNOPSIS also has a which parameter, and DESCRIPTION below explains it. The page's ARGUMENTS list also includes bits_to_change and values_for_bits β€” yes, even though the SYNOPSIS line above doesn't show them. I'm keeping every item exactly as listed. 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so XkbGetKeyboard allocates and returns a pointer to a keyboard description. It queries the server for those components specified in the which parameter for device device_spec and copies the results to the XkbDescRec it allocated. The remaining fields in the keyboard description are set to NULL. The valid masks for which are those listed in Table 1. πŸ’…

⭐ Table 1 Mask Bits for XkbDescRec ⭐

each bullet is Mask Bit β†’ XkbDescRec Field β†’ Value:

  • XkbControlsMask β†’ ctrls β†’ (1L<<0)
  • XkbServerMapMask β†’ server β†’ (1L<<1)
  • XkbIClientMapMask β†’ map β†’ (1L<<2)
  • XkbIndicatorMapMask β†’ indicators β†’ (1L<<3)
  • XkbNamesMask β†’ names β†’ (1L<<4)
  • XkbCompatMapMask β†’ compat β†’ (1L<<5)
  • XkbGeometryMask β†’ geom β†’ (1L<<6)
  • XkbAllComponentsMask β†’ All Fields β†’ (1L<<7)

XkbGetKeyboard is used to read the current description for one or more components of a keyboard device. It calls XkbGetKeyboardByName(3) as follows:

XkbGetKeyboardByName(dpy, device_spec, NULL, which, which, False).

If successful, XkbGetKeyboard returns a pointer to a newly allocated XkbDescRec structure, which is described in XkbGetKeyboardByName(3), and which should be freed with XkbFreeKeyboard(3). If XkbGetKeyboard does not succeed, it returns NULL. 😭

πŸ’€ DIAGNOSTICS πŸ’€

  • BadAlloc β€” Unable to allocate storage.

🌈 SEE ALSO 🌈


mwah πŸ’– this page is brought to you by X Version 11 and libX11 1.8.14; the footer has no explicit date printed here, and it signs off as XkbGetKeyboard(3). 🫢

πŸ“¦ where this page comes from