Module xkb

Source
Expand description

Integration with the XKB ecosystem.

This module provides integration with the XKB ecosystem, including

  • loading keymaps from buffers,
  • loading keymaps from RMLVO names,
  • loading keymaps from X11 connections,
  • loading the RMLVO registry,
  • loading XCompose files.

§Example

const MAP: &str = r#"
    xkb_keymap {
        // This empty map is not very useful. Under wayland, you would get
        // this map from the wl_keyboard.keymap event.
    };
"#;
let context = Context::default();
let keymap = context.keymap_from_bytes(WriteToLog, None, MAP).unwrap();
let builder = keymap.to_builder();
let _state_machine = builder.build_state_machine();
let _lookup_table = builder.build_lookup_table();

§Features

The following features are disabled by default:

  • registry - Provides access to the RMLVO registry. Most applications have no need for this.
  • compose - Allows loading XCompose files.
  • x11 - Allows loading keymaps from X11 connections.

§Logging

This crate does not write to STDERR and does not use the log crate. Instead, diagnostic messages are handled via the DiagnosticHandler trait that is accepted by functions that might produce diagnostic messages. This allows you to display these messages as you see fit.

To keep simple things simple, this crate provides the WriteToStderr and WriteToLog implementations that do the obvious things.

The WriteToLog type depends on the log crate and the feature of the same name, which is enabled by default.

Re-exports§

pub use keymap::Keymap;

Modules§

compose
XCompose helpers and types.
diagnostic
Diagnostic messages.
keymap
XKB keymaps.
registry
Types for working with the RMLVO registry.
rmlvo
RMLVO helpers and types.
x11
Integration with the x11rb crate.

Structs§

Context
An XKB context.
ContextBuilder
A builder for Context objects.