Skip to content

Missing keymap builder API #814

@wismill

Description

@wismill

The RFC about XKB “transformation” #546 led to the conclusion that a builder API would be a much better approach to solve the problem:

struct xkb_keymap_builder * builder = xkb_keymap_builder_new_from_names(ctx, names, flags);
// set symbols[3] = at where key = <AD01>
xkb_keymap_builder_transform_set_symbol(builder, "<AD01>", XK_Q, 3);
// copy <LCTL> into <CAPS>; // clone
xkb_keymap_builder_transform_duplicate_into(builder, "<LCTL>", "<CAPS>");

struct xkb_keymap *keymap = xkb_keymap_builder_build(builder);

My take is:

  • Design a new lib, e.g. xkbcommon-builder, to experiment with the API.
  • Focus on building a keymap initialized from RMLVO and common use cases such as: swap keys, add a modifier, etc.
  • Keep the API low-level, such that one can reuse the initial functions to propose a higher-level API, once we have enough feedback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    compile-keymapIndicates a need for improvements or additions to keymap compilation

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions