XkbSetIndicatorMap(3)

πŸ’… XkbSetIndicatorMap(3) β€” the XKB FUNCTIONS bestie ✨

🌸 NAME 🌸

XkbSetIndicatorMap β€” lowkey downloads the changes to the server based on modifications to a local copy of the keyboard description, and that update will update the maps for one or more indicators. periodt. πŸ’–

✨ SYNOPSIS ✨

the signature is literally:

Bool XkbSetIndicatorMap (Display *dpy, unsigned int which, XkbDescPtr
       desc);

πŸŽ€ ARGUMENTS πŸŽ€

okay so the arguments are giving:

  • dpy β€” connection to the X server.
  • which β€” mask of indicators to change.
  • desc β€” keyboard description from which the maps are taken.

πŸ’– DESCRIPTION πŸ’–

This section is all about what happens when you explicitly change indicators, depending on different settings in the indicator map. See Table 1 and Table 2 for the info on the effects of the indicator map fields when explicit changes are made. iykyk πŸ’…

πŸŽ€ Table 1: XkbIndicatorMapRec which_groups and groups, Indicator Drives Keyboard

Columns: which_groups Β· New State Β· Effect on Keyboard Group State

  • which_groups: XkbIM_UseNone β€” New State: On or Off. Effect: no effect.
  • which_groups: XkbIM_UseBase β€” New State: On or Off. Effect: no effect.
  • which_groups: XkbIM_UseLatched β€” New State: On. Effect: the groups field is treated as a group mask. The keyboard group latch is changed to the lowest numbered group specified in groups; if groups is empty, the keyboard group latch is changed to zero.
  • which_groups: XkbIM_UseLatched β€” New State: Off. Effect: the groups field is treated as a group mask. If the indicator is explicitly extinguished, keyboard group latch is changed to the lowest numbered group not specified in groups; if groups is zero, the keyboard group latch is set to the index of the highest legal keyboard group.
  • which_groups: XkbIM_UseLocked or XkbIM_UseEffective β€” New State: On. Effect: if the groups mask is empty, group is not changed; otherwise, the locked keyboard group is changed to the lowest numbered group specified in groups.
  • which_groups: XkbIM_UseLocked or XkbIM_UseEffective β€” New State: Off. Effect: the locked keyboard group is changed to the lowest numbered group that is not specified in the groups mask, or to Group1 if the groups mask contains all keyboard groups.

πŸ¦‹ Table 2: XkbIndicatorMapRec which_mods and mods, Indicator Drives Keyboard

Columns: which_mods Β· New State Β· Effect on Keyboard Modifiers

  • which_mods: XkbIM_UseNone or XkbIM_UseBase β€” New State: On or Off. Effect: No Effect.
  • which_mods: XkbIM_UseLatched β€” New State: On. Effect: any modifiers specified in the mask field of mods are added to the latched modifiers.
  • which_mods: XkbIM_UseLatched β€” New State: Off. Effect: any modifiers specified in the mask field of mods are removed from the latched modifiers.
  • which_mods: XkbIM_UseLocked, XkbIM_UseCompat, or XkbIM_UseEffective β€” New State: On. Effect: any modifiers specified in the mask field of mods are added to the locked modifiers.
  • which_mods: XkbIM_UseLocked β€” New State: Off. Effect: any modifiers specified in the mask field of mods are removed from the locked modifiers.
  • which_mods: XkbIM_UseCompat or XkbIM_UseEffective β€” New State: Off. Effect: any modifiers specified in the mask field of mods are removed from both the locked and latched modifiers.

okay so here’s the big one: if XkbIM_LEDDrivesKB is set and XkbIM_NoExplicit is not set, and you call a function that updates the server’s image of the indicator map (like XkbSetIndicatorMap or XkbSetNamedIndicator), Xkb changes the keyboard state and controls to reflect the other fields of the indicator map. If you try to explicitly change the value of an indicator where XkbIM_LEDDrivesKB is absent or where XkbIM_NoExplicit is present, keyboard state or controls are unaffected. πŸ’€

If neither XkbIM_NoAutomatic nor XkbIM_NoExplicit is set in an indicator map, Xkb honors any request to change the state of the indicator, but that new state might be immediately superseded by automatic changes to the indicator state if the keyboard state or controls change.

Changing an indicator that drives the keyboard is cumulative β€” highkey a single change can affect keyboard group, modifiers, and controls at the same time. πŸ‘‘

If you change an indicator where both XkbIM_LEDDrivesKB and XkbIM_NoAutomatic are specified, Xkb applies the keyboard changes specified in the other indicator map fields and changes the indicator to reflect the state you explicitly requested. The indicator stays in that new state until you explicitly change it again.

If XkbIM_NoAutomatic is not set and XkbIM_LEDDrivesKB is set, Xkb applies the changes specified in the other indicator map fields and sets the state of the indicator to the values specified by the indicator map. Heads up: in this case the indicator can end up in a different state than the one that was explicitly requested. For example, Xkb does not extinguish an indicator with which_mods of XkbIM_UseBase and mods of Shift if, at the time Xkb processes the request to extinguish the indicator, one of the Shift keys is physically depressed. 😭

If you explicitly light an indicator for which XkbIM_LEDDrivesKB is set, Xkb enables all of the boolean controls specified in the ctrls field of its indicator map. Explicitly extinguishing such an indicator causes Xkb to disable all of the boolean controls specified in ctrls.

For each bit set in the which parameter, XkbSetIndicatorMap sends the corresponding indicator map from the desc parameter to the server.

πŸ¦‹ SEE ALSO πŸ¦‹

XkbSetNamedIndicator(3)


and that’s the page, bestie πŸ’– β€” signed with X Version 11, libX11 1.8.14, and XkbSetIndicatorMap(3) πŸ’…βœ¨πŸ«Ά

πŸ“¦ where this page comes from