Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable out-of-range group action configuration using options API (take 3) #516

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

wismill
Copy link
Member

@wismill wismill commented Sep 28, 2024

In #487 I added keymap compile flags to configure the out-of-range group action, but it should be separate PR.

Note that I proposed previously:

My (hopefully) last proposal is to introduce a keymap compile options API. This will give us also more flexibility to introduce options that cannot (or not easily) be configured by flags.

TODO:

  • Get and use the corresponding control value from X11 for libxbbcommon-x11.
  • Fix remaining TODO/FIXME introduced in the code.
  • Complete the doc strings.

Added a new keymap compile options API:
- `xkb_keymap_compile_options_new`
- `xkb_keymap_compile_options_free`
- `xkb_keymap_new_from_names2`
- `xkb_keymap_new_from_file2`
- `xkb_keymap_new_from_buffer2`

This interface allows to configure keymap options that cannot be
passed as flags.
Enable the configuration of out-of-range layout handling using the new
function `xkb_keymap_compile_options_set_layout_out_of_range_action` and
the corresponding new enumeration `xkb_keymap_out_of_range_layout_action`:
- `XKB_KEYMAP_WRAP_OUT_OF_RANGE_LAYOUT`: wrap into range using integer
  modulus (default, as before).
- `XKB_KEYMAP_REDIRECT_OUT_OF_RANGE_LAYOUT`: redirect to a specific
  layout index.
- `XKB_KEYMAP_CLAMP_OUT_OF_RANGE_LAYOUT`: clamp into range, i.e. invalid
  indexes are corrected to the closest valid bound (0 or highest layout
  index).

When not specified, invalid groups are brought into range using integer
modulus.
@wismill wismill force-pushed the keymap/out-of-range-group-action3 branch from 58348ec to 0a0876f Compare September 28, 2024 06:44
@wismill wismill changed the title Enable out-of-range group action configuration using keymap flags (take 3) Enable out-of-range group action configuration using options API (take 3) Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant