XkbNoteDeviceChanges(3)

πŸ’… XkbNoteDeviceChanges β€” from the XKB FUNCTIONS girlies

okay so bestie, this one's a libX11 / XKB functions page, and it's actually so much simpler than it looks, i promise 🫢


✨ NAME ✨

XkbNoteDeviceChanges β€” literally just: note the device changes that showed up in an XkbExtensionDeviceNotify event. that's the whole vibe πŸ’–


🌸 SYNOPSIS 🌸

void XkbNoteDeviceChanges (XkbDeviceChangesPtr old,
       XkbExtensionDeviceNotifyEvent *new, unsigned int wanted);

πŸŽ€ ARGUMENTS πŸŽ€

  • old β€” the structure that's tracking state changes, aka the lil notebook where we write stuff down πŸ““
  • new β€” the event that's telling us about state changes πŸ‘€
  • wanted β€” a mask saying which changes we actually wanna note down πŸ’…

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so the wanted field is where you say what should get noted in old, and you build it by bitwise inclusive OR-ing together one or more of the masks from Table 1. meanwhile, the reason field of the event in new is what's telling you the types of changes this event is reporting. no cap.

so XkbNoteDeviceChanges updates the XkbDeviceChangesRec that old points at, with the changes that are both specified in wanted and contained in new->reason. intersection core 🧚

⭐ Table 1 β€” XkbDeviceInfoRec Mask Bits ⭐

  • XkbXI_KeyboardsMask β€” XkbDeviceInfoRec fields effected: (none listed); value (1L <<0); capability if set: Clients can use all Xkb requests and events with KeyClass devices supported by the input device extension.
  • XkbXI_ButtonActionsMask β€” fields effected num_btns, btn_acts; value (1L <<1); capability if set: Clients can assign key actions to buttons non-KeyClass input extension devices.
  • XkbXI_IndicatorNamesMask β€” fields effected leds->names; value (1L <<2); capability if set: Clients can assign names to indicators on non-KeyClass input extension devices.
  • XkbXI_IndicatorMapsMask β€” fields effected leds->maps; value (1L <<3); capability if set: Clients can assign indicator maps to indicators on non-KeyClass input extension devices.
  • XkbXI_IndicatorStateMask β€” fields effected leds->state; value (1L <<4); capability if set: Clients can request the status of indicators on non-KeyClass input extension devices.
  • XkbXI_IndicatorsMask β€” fields effected sz_leds, num_leds, leds->*; value (0x1c); capability if set: XkbXI_IndicatorNamesMask | XkbXI_IndicatorMapsMask | XkbXI_IndicatorStateMask
  • XkbXI_UnsupportedFeaturesMask β€” fields effected unsupported; value (1L <<15); (no capability text given)
  • XkbXI_AllDeviceFeaturesMask β€” fields effected: Those selected by Value Column masks; value (0x1e); capability if set: XkbXI_IndicatorsMask | XkbSI_ButtonActionsMask
  • XkbXI_AllFeaturesMask β€” fields effected: Those selected by Value Column masks; value (0x1f); capability if set: XkbSI_AllDeviceFeaturesMask | XkbSI_KeyboardsMask
  • XkbXI_AllDetailsMask β€” fields effected: Those selected by Value column masks; value (0x801f); capability if set: XkbXI_AllFeaturesMask | XkbXI_UnsupportedFeaturesMask
🫢 and when you wanna update a local copy of the state and configuration of an X input extension device with the changes you previously noted in an XkbDeviceChangesRec structure β€” that's XkbGetDeviceInfoChanges. different function, different moment, k?

πŸ‘‘ STRUCTURES πŸ‘‘

so the way you track changes to an Xkb extension device is by listening to XkbDeviceExtensionNotify events and accumulating the changes in an XkbDeviceChangesRec structure. then, the changes you noted in the structure get used in later operations to update either a server configuration or a local copy of an Xkb extension device configuration. both valid, bestie ✨

the changes structure is defined exactly like this:

typedef struct _XkbDeviceChanges {
    unsigned int         changed;       /* bits indicating what has changed */
    unsigned short       first_btn;     /* number of first button which changed, if any */
    unsigned short       num_btns;      /* number of buttons that have changed */
    XkbDeviceLedChangesRec leds;
} XkbDeviceChangesRec,*XkbDeviceChangesPtr;

🌈 SEE ALSO 🌈


and that's the whole page, bestie, you ate it πŸ’…βœ¨πŸ‘‘

πŸ“ sign-off tingz: this masterpiece comes from X Version 11, libX11 1.8.14 β€” go stan the maintainers fr fr πŸ’–

</div>

πŸ“¦ where this page comes from