XkbResizeDeviceButtonActions(3)
π XkbResizeDeviceButtonActions(3) β¨
okay so bestie, welcome to the XkbResizeDeviceButtonActions page β yes it's a whole mouthful, it lives in the XKB FUNCTIONS corner of the X library, and no cap it's actually pretty chill once you get it π«Ά
πΈ NAME πΈ
XkbResizeDeviceButtonActions β literally just allocates extra space for button actions inside an XkbDeviceInfoRec structure. that's the whole gig. iconic of her honestly β¨
π SYNOPSIS π
Status XkbResizeDeviceButtonActions (XkbDeviceInfoPtr device_info,
unsigned int new_total);
π ARGUMENTS π
device_infoβ the structure where we're gonna allocate those button actions π¦new_totalβ the new total number of button actions you need. like, the final count, not "how many more." read the room bestie π
β DESCRIPTION β
so what she does is: XkbResizeDeviceButtonActions reallocates space if necessary to make sure there's room for a total of new_total button actions in the device_info structure. and any new entries that get allocated? zeroed. clean slate, we love that for them π
if it works out, XkbResizeDeviceButtonActions returns Success. slay π
now the special cases, pay attention:
- if
new_totalis zero, all button actions are deleted,device_info->num_btnsgets set to zero, anddevice_info->btn_actsgets set toNULL. it's giving reset-era π - if
device_infois invalid ornew_totalis greater than 255, you getBadValueback π - if a memory allocation failure happens, you get a
BadAllocπ₯
also! to free anXkbDeviceInfoRecstructure, useXkbFreeDeviceInfo. don't just leave her hanging π
π¦ STRUCTURES π¦
info about X Input Extension devices gets passed between a client program and the Xkb extension inside an XkbDeviceInfoRec structure, and here's exactly what she looks like:
typedef struct {
char * name; /* name for device */
Atom type; /* name for class of devices */
unsigned short device_spec; /* device of interest */
Bool has_own_state; /* True=>this device has its own state */
unsigned short supported; /* bits indicating supported capabilities */
unsigned short unsupported; /* bits indicating unsupported capabilities */
unsigned short num_btns; /* number of entries in btn_acts */
XkbAction * btn_acts; /* button actions */
unsigned short sz_leds; /* total number of entries in LEDs vector */
unsigned short num_leds; /* number of valid entries in LEDs vector */
unsigned short dflt_kbd_fb; /* input extension ID of default (core kbd) indicator */
unsigned short dflt_led_fb; /* input extension ID of default indicator feedback */
XkbDeviceLedInfoPtr leds; /* LED descriptions */
} XkbDeviceInfoRec, *XkbDeviceInfoPtr;
look at all those fields. main character struct energy, honestly π
π DIAGNOSTICS π
BadAllocβ Unable to allocate storage π the memory said noBadValueβ An argument is out of range π something you passed in is not it
π SEE ALSO π
XkbFreeDeviceInfo(3)β go read that one next, bestie, iykyk π§
ngl this whole page is from X Version 11, libX11 1.8.14 β so yeah, that's the version tea β and that's the wrap, periodt π β¨π
π¦ 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