From 6f0b4e55e4489bcd8e037b6a0bfccd4d033a91bd Mon Sep 17 00:00:00 2001 From: Eivind Gamst Date: Fri, 24 Apr 2026 14:36:31 +0200 Subject: [PATCH 1/5] Quality of life improvements --- .github/workflows/benchmark.yml | 24 +- .github/workflows/tests.yml | 3 + Cargo.toml | 10 +- README.md | 10 + benches/bench_compose.rs | 252 +++++++++ benches/bench_key.rs | 374 +++++++++++++ benches/bench_setup.rs | 139 +++++ benches/bench_speed.rs | 832 ---------------------------- benches/common.rs | 192 ++++--- scripts/generate_benchmark_table.js | 8 +- src/xkb.rs | 10 +- tests/compile.rs | 122 ++++ tests/type.rs | 255 +++++++++ tests/unicode.rs | 85 +++ xkb-core/README.md | 6 +- xkb-core/src/rust_types.rs | 101 +++- 16 files changed, 1513 insertions(+), 910 deletions(-) create mode 100644 benches/bench_compose.rs create mode 100644 benches/bench_key.rs create mode 100644 benches/bench_setup.rs delete mode 100644 benches/bench_speed.rs create mode 100644 tests/compile.rs create mode 100644 tests/type.rs create mode 100644 tests/unicode.rs diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 5bb43442..492acdb1 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -28,7 +28,10 @@ jobs: uses: Swatinem/rust-cache@v2 - name: Run criterion benchmarks - run: cargo bench --bench bench_speed + run: | + cargo bench --bench bench_setup + cargo bench --bench bench_key + cargo bench --bench bench_compose - name: Run memory benchmark run: | @@ -43,10 +46,23 @@ jobs: strip target/release/examples/bench_size_wkb strip target/release/examples/bench_size_xkbcommon strip target/release/examples/bench_size_xkbcommon_dl + # Find libxkbcommon.so and get its stripped size (xkbcommon/xkbcommon-dl depend on it) + LIBXKB=$(find /usr/lib64 /usr/lib -name 'libxkbcommon.so.0.*' 2>/dev/null | head -1) + if [ -n "$LIBXKB" ]; then + strip --strip-all -o /tmp/libxkbcommon_stripped.so "$LIBXKB" + LIBXKB_SIZE=$(stat -c%s /tmp/libxkbcommon_stripped.so) + else + LIBXKB_SIZE=0 + fi + WKB_SIZE=$(stat -c%s target/release/examples/bench_size_wkb) + XKB_BIN=$(stat -c%s target/release/examples/bench_size_xkbcommon) + XKB_DL_BIN=$(stat -c%s target/release/examples/bench_size_xkbcommon_dl) + XKB_TOTAL=$((XKB_BIN + LIBXKB_SIZE)) + XKB_DL_TOTAL=$((XKB_DL_BIN + LIBXKB_SIZE)) { - echo "wkb $(stat -c%s target/release/examples/bench_size_wkb)" - echo "xkbcommon $(stat -c%s target/release/examples/bench_size_xkbcommon)" - echo "xkbcommon-dl $(stat -c%s target/release/examples/bench_size_xkbcommon_dl)" + echo "wkb ${WKB_SIZE}" + echo "xkbcommon ${XKB_TOTAL}" + echo "xkbcommon-dl ${XKB_DL_TOTAL}" } > /tmp/size_output.txt - name: Generate benchmark table diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0a1b033c..af35906d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -68,11 +68,14 @@ jobs: - compose - ctrl_keys - keymap + - compile + - type - layouts - led_lights - level - modifiers - repeat + - unicode steps: - name: Install system dependencies run: dnf install -y gcc libxkbcommon-devel xkeyboard-config libX11-common diff --git a/Cargo.toml b/Cargo.toml index 0ee2a1e0..8d71f35e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,7 +40,15 @@ xkbcommon-compat = { path = "xkbcommon-compat" } criterion = { version = "0.5", features = ["html_reports"] } [[bench]] -name = "bench_speed" +name = "bench_setup" +harness = false + +[[bench]] +name = "bench_key" +harness = false + +[[bench]] +name = "bench_compose" harness = false [[example]] diff --git a/README.md b/README.md index 9457decd..74d70c45 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ # wkb — Wayland Keyboard +[![Crates.io](https://img.shields.io/crates/v/wayland-keyboard.svg)](https://crates.io/crates/wayland-keyboard) +[![Documentation](https://docs.rs/wayland-keyboard/badge.svg)](https://docs.rs/wayland-keyboard) +[![License](https://img.shields.io/crates/l/wayland-keyboard.svg)](https://github.com/rano-oss/wkb/blob/main/LICENSE) +[![Test Status](https://img.shields.io/github/actions/workflow/status/rano-oss/wkb/tests.yml?branch=main&event=push&label=tests)](https://github.com/rano-oss/wkb/actions) + A lightweight, pure Rust keyboard handling library for Wayland. WKB is a drop-in alternative to `xkbcommon` that compiles XKB keymaps, tracks modifier and compose state, and maps evdev key codes to characters — all without C @@ -20,6 +25,11 @@ dependencies. ## Quick Start +```toml +[dependencies] +wayland-keyboard = "0.1" +``` + ```rust use wkb::{WKB, KeyDirection}; diff --git a/benches/bench_compose.rs b/benches/bench_compose.rs new file mode 100644 index 00000000..08faa9f3 --- /dev/null +++ b/benches/bench_compose.rs @@ -0,0 +1,252 @@ +mod common; + +use common::*; +use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion}; +use std::ffi::CString; +use std::time::Duration; + +fn cfg() -> Criterion { + Criterion::default() + .warm_up_time(Duration::from_millis(50)) + .measurement_time(Duration::from_millis(200)) + .sample_size(10) +} + +fn bench_compose_table_creation(c: &mut Criterion) { + let mut group = c.benchmark_group("compose/table_creation"); + let locale = COMPOSE_LOCALE; + + group.bench_function("wkb", |b| { + b.iter(|| { + let resolved = xkb_core::compose::resolve_compose_file(black_box(locale)); + if let Some(subpath) = resolved { + let path = std::path::Path::new("/usr/share/X11/locale").join(&subpath); + let composer = wkb::testing::compose_parse::load_compose_from_path(&path); + black_box(composer); + } + }); + }); + + group.bench_function("xkbcommon", |b| { + use xkbcommon::xkb; + let ctx = xkb::Context::new(xkb::CONTEXT_NO_FLAGS); + let locale_os = std::ffi::OsStr::new(locale); + b.iter(|| { + let table = xkb::compose::Table::new_from_locale( + &ctx, + locale_os, + xkb::compose::COMPILE_NO_FLAGS, + ); + let _ = black_box(table); + }); + }); + + group.bench_function("xkbcommon-dl", |b| { + let xkb = xkbcommon_dl::xkbcommon_handle(); + let xkb_compose = xkbcommon_dl::xkbcommon_compose_handle(); + let ctx = + unsafe { (xkb.xkb_context_new)(xkbcommon_dl::xkb_context_flags::XKB_CONTEXT_NO_FLAGS) }; + let c_locale = CString::new(locale).unwrap(); + b.iter(|| { + let table = unsafe { + (xkb_compose.xkb_compose_table_new_from_locale)( + ctx, + c_locale.as_ptr(), + xkbcommon_dl::xkb_compose_compile_flags::XKB_COMPOSE_COMPILE_NO_FLAGS, + ) + }; + black_box(table); + if !table.is_null() { + unsafe { (xkb_compose.xkb_compose_table_unref)(table) }; + } + }); + unsafe { (xkb.xkb_context_unref)(ctx) }; + }); + + group.finish(); +} + +fn bench_compose_state_creation(c: &mut Criterion) { + let mut group = c.benchmark_group("compose/state_creation"); + let locale = COMPOSE_LOCALE; + + { + let resolved = xkb_core::compose::resolve_compose_file(locale); + let path = resolved.map(|s| { + std::path::Path::new("/usr/share/X11/locale") + .join(&s) + .to_path_buf() + }); + group.bench_function("wkb", |b| { + b.iter(|| { + if let Some(ref p) = path { + let composer = wkb::testing::compose_parse::load_compose_from_path(p); + black_box(composer); + } + }); + }); + } + + { + use xkbcommon::xkb; + let ctx = xkb::Context::new(xkb::CONTEXT_NO_FLAGS); + let locale_os = std::ffi::OsStr::new(locale); + let table = + xkb::compose::Table::new_from_locale(&ctx, locale_os, xkb::compose::COMPILE_NO_FLAGS) + .expect("compose table"); + group.bench_function("xkbcommon", |b| { + b.iter(|| { + let state = xkb::compose::State::new(&table, xkb::compose::STATE_NO_FLAGS); + black_box(state); + }); + }); + } + + { + let xkb = xkbcommon_dl::xkbcommon_handle(); + let xkb_compose = xkbcommon_dl::xkbcommon_compose_handle(); + let ctx = + unsafe { (xkb.xkb_context_new)(xkbcommon_dl::xkb_context_flags::XKB_CONTEXT_NO_FLAGS) }; + let c_locale = CString::new(locale).unwrap(); + let table = unsafe { + (xkb_compose.xkb_compose_table_new_from_locale)( + ctx, + c_locale.as_ptr(), + xkbcommon_dl::xkb_compose_compile_flags::XKB_COMPOSE_COMPILE_NO_FLAGS, + ) + }; + group.bench_function("xkbcommon-dl", |b| { + b.iter(|| { + let state = unsafe { + (xkb_compose.xkb_compose_state_new)( + table, + xkbcommon_dl::xkb_compose_state_flags::XKB_COMPOSE_STATE_NO_FLAGS, + ) + }; + black_box(state); + if !state.is_null() { + unsafe { (xkb_compose.xkb_compose_state_unref)(state) }; + } + }); + }); + unsafe { + (xkb_compose.xkb_compose_table_unref)(table); + (xkb.xkb_context_unref)(ctx); + }; + } + + group.finish(); +} + +fn bench_compose_feed(c: &mut Criterion) { + let mut group = c.benchmark_group("compose/feed"); + + for seq in COMPOSE_SEQUENCES { + { + let resolved = xkb_core::compose::resolve_compose_file(COMPOSE_LOCALE); + let path = resolved.map(|s| { + std::path::Path::new("/usr/share/X11/locale") + .join(&s) + .to_path_buf() + }); + if let Some(ref p) = path { + let mut composer = wkb::testing::compose_parse::load_compose_from_path(p); + use wkb::testing::Composer; + let tokens: Vec = seq + .keysyms + .iter() + .filter_map(|&ks| { + xkb_core::keysym_utf::keysym_to_char(ks).map(wkb::testing::Token::Char) + }) + .collect(); + group.bench_with_input(BenchmarkId::new("wkb", seq.name), &tokens, |b, tokens| { + b.iter(|| { + for token in tokens { + black_box(composer.feed(*token)); + } + }); + }); + } + } + + { + use xkbcommon::xkb; + let ctx = xkb::Context::new(xkb::CONTEXT_NO_FLAGS); + let locale_os = std::ffi::OsStr::new(COMPOSE_LOCALE); + if let Ok(table) = xkb::compose::Table::new_from_locale( + &ctx, + locale_os, + xkb::compose::COMPILE_NO_FLAGS, + ) { + let mut state = xkb::compose::State::new(&table, xkb::compose::STATE_NO_FLAGS); + group.bench_with_input( + BenchmarkId::new("xkbcommon", seq.name), + &seq.keysyms, + |b, keysyms| { + b.iter(|| { + for &ks in *keysyms { + black_box(state.feed(xkb::Keysym::new(ks))); + } + state.reset(); + }); + }, + ); + } + } + + { + let xkb = xkbcommon_dl::xkbcommon_handle(); + let xkb_compose = xkbcommon_dl::xkbcommon_compose_handle(); + let ctx = unsafe { + (xkb.xkb_context_new)(xkbcommon_dl::xkb_context_flags::XKB_CONTEXT_NO_FLAGS) + }; + let c_locale = CString::new(COMPOSE_LOCALE).unwrap(); + let table = unsafe { + (xkb_compose.xkb_compose_table_new_from_locale)( + ctx, + c_locale.as_ptr(), + xkbcommon_dl::xkb_compose_compile_flags::XKB_COMPOSE_COMPILE_NO_FLAGS, + ) + }; + if !table.is_null() { + let state = unsafe { + (xkb_compose.xkb_compose_state_new)( + table, + xkbcommon_dl::xkb_compose_state_flags::XKB_COMPOSE_STATE_NO_FLAGS, + ) + }; + group.bench_with_input( + BenchmarkId::new("xkbcommon-dl", seq.name), + &seq.keysyms, + |b, keysyms| { + b.iter(|| { + for &ks in *keysyms { + black_box(unsafe { + (xkb_compose.xkb_compose_state_feed)(state, ks) + }); + } + unsafe { (xkb_compose.xkb_compose_state_reset)(state) }; + }); + }, + ); + unsafe { + (xkb_compose.xkb_compose_state_unref)(state); + (xkb_compose.xkb_compose_table_unref)(table); + (xkb.xkb_context_unref)(ctx); + }; + } + } + } + + group.finish(); +} + +criterion_group! { + name = benches; + config = cfg(); + targets = + bench_compose_table_creation, + bench_compose_state_creation, + bench_compose_feed, +} +criterion_main!(benches); diff --git a/benches/bench_key.rs b/benches/bench_key.rs new file mode 100644 index 00000000..3a79c2fc --- /dev/null +++ b/benches/bench_key.rs @@ -0,0 +1,374 @@ +mod common; + +use common::*; +use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion}; +use std::ffi::CString; +use std::os::raw::c_char; +use std::ptr; +use std::time::Duration; +use wkb::testing::WKBTestExt; +use wkb::KeyDirection; + +fn cfg() -> Criterion { + Criterion::default() + .warm_up_time(Duration::from_millis(50)) + .measurement_time(Duration::from_millis(200)) + .sample_size(10) +} + +// ── Setup helpers ────────────────────────────────────────────────────── + +fn wkb_setup(locale: &str, variant: Option<&str>) -> wkb::WKB { + wkb::WKB::new_from_names(locale.to_string(), variant.map(String::from)) +} + +fn xkbcommon_setup( + locale: &str, + variant: Option<&str>, +) -> ( + xkbcommon::xkb::Context, + xkbcommon::xkb::Keymap, + xkbcommon::xkb::State, +) { + use xkbcommon::xkb; + let ctx = xkb::Context::new(xkb::CONTEXT_NO_FLAGS); + let km = xkb::Keymap::new_from_names( + &ctx, + "evdev", + "", + locale, + variant.unwrap_or(""), + None, + xkb::KEYMAP_COMPILE_NO_FLAGS, + ) + .expect("xkbcommon keymap"); + let st = xkb::State::new(&km); + (ctx, km, st) +} + +fn xkbcommon_dl_setup( + locale: &str, + variant: Option<&str>, +) -> ( + &'static xkbcommon_dl::XkbCommon, + *mut xkbcommon_dl::xkb_context, + *mut xkbcommon_dl::xkb_keymap, + *mut xkbcommon_dl::xkb_state, +) { + let xkb = xkbcommon_dl::xkbcommon_handle(); + let ctx = + unsafe { (xkb.xkb_context_new)(xkbcommon_dl::xkb_context_flags::XKB_CONTEXT_NO_FLAGS) }; + let c_rules = CString::new("evdev").unwrap(); + let c_layout = CString::new(locale).unwrap(); + let c_variant = variant.map(|v| CString::new(v).unwrap()); + let names = xkbcommon_dl::xkb_rule_names { + rules: c_rules.as_ptr(), + model: ptr::null(), + layout: c_layout.as_ptr(), + variant: c_variant.as_ref().map_or(ptr::null(), |v| v.as_ptr()), + options: ptr::null(), + }; + let km = unsafe { + (xkb.xkb_keymap_new_from_names)( + ctx, + &names, + xkbcommon_dl::xkb_keymap_compile_flags::XKB_KEYMAP_COMPILE_NO_FLAGS, + ) + }; + let st = unsafe { (xkb.xkb_state_new)(km) }; + (xkb, ctx, km, st) +} + +/// Iterate over (layout_id, locale, variant) for a given case. +fn layouts_for_case(case_name: &str) -> Vec<(String, &'static str, Option<&'static str>)> { + let (pl, pv) = PRIMARY_LAYOUT; + let mut out = vec![(pv.map_or(pl.to_string(), |v| format!("{pl}_{v}")), pl, pv)]; + if LAYOUT_SENSITIVE_CASES.contains(&case_name) { + for &(l, v) in EXTRA_LAYOUTS { + out.push((v.map_or(l.to_string(), |vv| format!("{l}_{vv}")), l, v)); + } + } + out +} + +// ── Macros to reduce per-impl boilerplate ────────────────────────────── + +macro_rules! bench_wkb { + ($group:expr, $bid:expr, $locale:expr, $variant:expr, $case:expr, $body:expr) => {{ + let mut wb = wkb_setup($locale, $variant); + let case_keys = $case.keys; + $group.bench_function(BenchmarkId::new("wkb", &$bid), |b| { + b.iter(|| { + for &(code, down) in case_keys { + let dir = if down { + KeyDirection::Down + } else { + KeyDirection::Up + }; + #[allow(clippy::redundant_closure_call)] + ($body)(&mut wb, code, down, dir); + } + }); + }); + }}; +} + +macro_rules! bench_xkb { + ($group:expr, $bid:expr, $locale:expr, $variant:expr, $case:expr, $body:expr) => {{ + use xkbcommon::xkb; + let (_ctx, _km, mut st) = xkbcommon_setup($locale, $variant); + let case_keys = $case.keys; + $group.bench_function(BenchmarkId::new("xkbcommon", &$bid), |b| { + b.iter(|| { + for &(code, down) in case_keys { + let kc = xkb::Keycode::new(code + EVDEV_OFFSET); + let dir = if down { + xkb::KeyDirection::Down + } else { + xkb::KeyDirection::Up + }; + #[allow(clippy::redundant_closure_call)] + ($body)(&mut st, kc, down, dir); + } + }); + }); + }}; +} + +macro_rules! bench_dl { + ($group:expr, $bid:expr, $locale:expr, $variant:expr, $case:expr, $body:expr) => {{ + let (xkb, ctx, km, st) = xkbcommon_dl_setup($locale, $variant); + let case_keys = $case.keys; + $group.bench_function(BenchmarkId::new("xkbcommon-dl", &$bid), |b| { + b.iter(|| { + for &(code, down) in case_keys { + let kc = code + EVDEV_OFFSET; + let dir = if down { + xkbcommon_dl::xkb_key_direction::XKB_KEY_DOWN + } else { + xkbcommon_dl::xkb_key_direction::XKB_KEY_UP + }; + #[allow(clippy::redundant_closure_call)] + ($body)(xkb, st, kc, down, dir); + } + }); + }); + unsafe { + (xkb.xkb_state_unref)(st); + (xkb.xkb_keymap_unref)(km); + (xkb.xkb_context_unref)(ctx); + } + }}; +} + +// ── key/update ───────────────────────────────────────────────────────── + +fn bench_key_update(c: &mut Criterion) { + let mut group = c.benchmark_group("key/update"); + + for case in KEY_CASES { + for (lid, locale, variant) in layouts_for_case(case.name) { + let bid = format!("{lid}/{}", case.name); + + bench_wkb!( + group, + bid, + locale, + variant, + case, + |wb: &mut wkb::WKB, + code: u32, + _down: bool, + dir: KeyDirection| { + black_box(wb.update_key(black_box(code), dir)); + } + ); + + bench_xkb!( + group, + bid, + locale, + variant, + case, + |st: &mut xkbcommon::xkb::State, + kc: xkbcommon::xkb::Keycode, + _down: bool, + dir: xkbcommon::xkb::KeyDirection| { + black_box(st.update_key(kc, dir)); + } + ); + + bench_dl!( + group, + bid, + locale, + variant, + case, + |xkb: &xkbcommon_dl::XkbCommon, + st: *mut xkbcommon_dl::xkb_state, + kc: u32, + _down: bool, + dir: xkbcommon_dl::xkb_key_direction| { + black_box(unsafe { (xkb.xkb_state_update_key)(st, kc, dir) }); + } + ); + } + } + group.finish(); +} + +// ── key/get_utf8 ─────────────────────────────────────────────────────── + +fn bench_key_get_utf8(c: &mut Criterion) { + let mut group = c.benchmark_group("key/get_utf8"); + + for case in KEY_CASES { + for (lid, locale, variant) in layouts_for_case(case.name) { + let bid = format!("{lid}/{}", case.name); + + bench_wkb!( + group, + bid, + locale, + variant, + case, + |wb: &mut wkb::WKB, + code: u32, + down: bool, + dir: KeyDirection| { + wb.update_key(code, dir); + if down { + black_box(wb.utf8(black_box(code))); + } + } + ); + + bench_xkb!( + group, + bid, + locale, + variant, + case, + |st: &mut xkbcommon::xkb::State, + kc: xkbcommon::xkb::Keycode, + down: bool, + dir: xkbcommon::xkb::KeyDirection| { + st.update_key(kc, dir); + if down { + black_box(st.key_get_utf8(black_box(kc))); + } + } + ); + + { + let (xkb, ctx, km, st) = xkbcommon_dl_setup(locale, variant); + let case_keys = case.keys; + let mut buf = [0u8; 64]; + group.bench_function(BenchmarkId::new("xkbcommon-dl", &bid), |b| { + b.iter(|| { + for &(code, down) in case_keys { + let kc = code + EVDEV_OFFSET; + let dir = if down { + xkbcommon_dl::xkb_key_direction::XKB_KEY_DOWN + } else { + xkbcommon_dl::xkb_key_direction::XKB_KEY_UP + }; + unsafe { (xkb.xkb_state_update_key)(st, kc, dir) }; + if down { + black_box(unsafe { + (xkb.xkb_state_key_get_utf8)( + st, + black_box(kc), + buf.as_mut_ptr() as *mut c_char, + buf.len(), + ) + }); + } + } + }); + }); + unsafe { + (xkb.xkb_state_unref)(st); + (xkb.xkb_keymap_unref)(km); + (xkb.xkb_context_unref)(ctx); + } + } + } + } + group.finish(); +} + +// ── key/get_sym ──────────────────────────────────────────────────────── + +fn bench_key_get_sym(c: &mut Criterion) { + let mut group = c.benchmark_group("key/get_sym"); + + for case in KEY_CASES { + for (lid, locale, variant) in layouts_for_case(case.name) { + let bid = format!("{lid}/{}", case.name); + + bench_wkb!( + group, + bid, + locale, + variant, + case, + |wb: &mut wkb::WKB, + code: u32, + down: bool, + dir: KeyDirection| { + wb.update_key(code, dir); + if down { + black_box(wb.utf8(black_box(code))); + } + } + ); + + bench_xkb!( + group, + bid, + locale, + variant, + case, + |st: &mut xkbcommon::xkb::State, + kc: xkbcommon::xkb::Keycode, + down: bool, + dir: xkbcommon::xkb::KeyDirection| { + st.update_key(kc, dir); + if down { + black_box(st.key_get_one_sym(black_box(kc))); + } + } + ); + + bench_dl!( + group, + bid, + locale, + variant, + case, + |xkb: &xkbcommon_dl::XkbCommon, + st: *mut xkbcommon_dl::xkb_state, + kc: u32, + down: bool, + dir: xkbcommon_dl::xkb_key_direction| { + unsafe { (xkb.xkb_state_update_key)(st, kc, dir) }; + if down { + black_box(unsafe { (xkb.xkb_state_key_get_one_sym)(st, black_box(kc)) }); + } + } + ); + } + } + group.finish(); +} + +criterion_group! { + name = benches; + config = cfg(); + targets = + bench_key_update, + bench_key_get_utf8, + bench_key_get_sym, +} +criterion_main!(benches); diff --git a/benches/bench_setup.rs b/benches/bench_setup.rs new file mode 100644 index 00000000..3a5167b7 --- /dev/null +++ b/benches/bench_setup.rs @@ -0,0 +1,139 @@ +mod common; + +use common::*; +use criterion::{black_box, criterion_group, criterion_main, Criterion}; +use std::ffi::CString; +use std::ptr; +use std::time::Duration; + +fn cfg() -> Criterion { + Criterion::default() + .warm_up_time(Duration::from_millis(50)) + .measurement_time(Duration::from_millis(300)) + .sample_size(10) +} + +fn compat_setup( + locale: &str, + variant: Option<&str>, +) -> (xkb_core::rust_types::Keymap, xkb_core::rust_types::State) { + use xkb_core::rust_types::{Context, RuleNames}; + let ctx = Context::new().expect("xkb-core context"); + let rmlvo = RuleNames { + rules: "evdev".to_string(), + model: String::new(), + layout: locale.to_string(), + variant: variant.unwrap_or("").to_string(), + options: String::new(), + }; + let km = ctx.keymap_from_names(&rmlvo).expect("xkb-core keymap"); + let st = km.new_state().expect("xkb-core state"); + (km, st) +} + +fn bench_full_setup(c: &mut Criterion) { + let mut group = c.benchmark_group("full_setup"); + let locale = "us"; + + group.bench_function("wkb", |b| { + b.iter(|| { + let wkb: wkb::WKB = + wkb::WKB::new_from_names(black_box(locale).to_string(), None); + black_box(wkb); + }); + }); + + group.bench_function("xkbcommon", |b| { + use xkbcommon::xkb; + b.iter(|| { + let ctx = xkb::Context::new(xkb::CONTEXT_NO_FLAGS); + let km = xkb::Keymap::new_from_names( + &ctx, + "evdev", + "", + black_box(locale), + "", + None, + xkb::KEYMAP_COMPILE_NO_FLAGS, + ) + .expect("keymap"); + let st = xkb::State::new(&km); + let locale_os = std::ffi::OsStr::new(COMPOSE_LOCALE); + let table = xkb::compose::Table::new_from_locale( + &ctx, + locale_os, + xkb::compose::COMPILE_NO_FLAGS, + ); + let cs = table + .as_ref() + .map(|t| xkb::compose::State::new(t, xkb::compose::STATE_NO_FLAGS)); + black_box(&table); + black_box(&cs); + let _ = black_box((ctx, km, st)); + }); + }); + + group.bench_function("xkbcommon-dl", |b| { + let xkb = xkbcommon_dl::xkbcommon_handle(); + let xkb_compose = xkbcommon_dl::xkbcommon_compose_handle(); + let c_locale = CString::new(COMPOSE_LOCALE).unwrap(); + b.iter(|| { + let ctx = unsafe { + (xkb.xkb_context_new)(xkbcommon_dl::xkb_context_flags::XKB_CONTEXT_NO_FLAGS) + }; + let rmlvo = xkbcommon_dl::xkb_rule_names { + rules: c"evdev".as_ptr(), + model: ptr::null(), + layout: c"us".as_ptr(), + variant: ptr::null(), + options: ptr::null(), + }; + let km = unsafe { + (xkb.xkb_keymap_new_from_names)( + ctx, + &rmlvo, + xkbcommon_dl::xkb_keymap_compile_flags::XKB_KEYMAP_COMPILE_NO_FLAGS, + ) + }; + let st = unsafe { (xkb.xkb_state_new)(km) }; + let table = unsafe { + (xkb_compose.xkb_compose_table_new_from_locale)( + ctx, + c_locale.as_ptr(), + xkbcommon_dl::xkb_compose_compile_flags::XKB_COMPOSE_COMPILE_NO_FLAGS, + ) + }; + let cs = if !table.is_null() { + unsafe { + (xkb_compose.xkb_compose_state_new)( + table, + xkbcommon_dl::xkb_compose_state_flags::XKB_COMPOSE_STATE_NO_FLAGS, + ) + } + } else { + ptr::null_mut() + }; + black_box((ctx, km, st, table, cs)); + if !cs.is_null() { + unsafe { (xkb_compose.xkb_compose_state_unref)(cs) }; + } + if !table.is_null() { + unsafe { (xkb_compose.xkb_compose_table_unref)(table) }; + } + unsafe { + (xkb.xkb_state_unref)(st); + (xkb.xkb_keymap_unref)(km); + (xkb.xkb_context_unref)(ctx); + } + }); + }); + + group.finish(); +} + +criterion_group! { + name = benches; + config = cfg(); + targets = bench_full_setup, +} +criterion_main!(benches); diff --git a/benches/bench_speed.rs b/benches/bench_speed.rs deleted file mode 100644 index 4ef89d9a..00000000 --- a/benches/bench_speed.rs +++ /dev/null @@ -1,832 +0,0 @@ -mod common; - -use common::*; -use criterion::{black_box, criterion_group, criterion_main, BenchmarkId, Criterion}; -use std::ffi::CString; -use std::os::raw::c_char; -use std::ptr; -use std::time::Duration; -use wkb::KeyDirection; -use wkb::testing::WKBTestExt; - -fn fast() -> Criterion { - Criterion::default() - .warm_up_time(Duration::from_millis(100)) - .measurement_time(Duration::from_millis(500)) - .sample_size(20) -} - -// ════════════════════════════════════════════════════════════════════════ -// COMPAT HELPERS — call xkb-core Rust API directly (same code path as -// xkbcommon-compat, but avoids #[no_mangle] symbol collision with libxkbcommon) -// ════════════════════════════════════════════════════════════════════════ - -fn compat_setup( - locale: &str, - variant: Option<&str>, -) -> (xkb_core::rust_types::Keymap, xkb_core::rust_types::State) { - use xkb_core::rust_types::{Context, RuleNames}; - let ctx = Context::new().expect("xkb-core context"); - let rmlvo = RuleNames { - rules: "evdev".to_string(), - model: String::new(), - layout: locale.to_string(), - variant: variant.unwrap_or("").to_string(), - options: String::new(), - }; - let km = ctx.keymap_from_names(&rmlvo).expect("xkb-core keymap"); - let st = km.new_state().expect("xkb-core state"); - (km, st) -} - -// ════════════════════════════════════════════════════════════════════════ -// 1. COMPOSE BENCHMARKS -// ════════════════════════════════════════════════════════════════════════ - -fn bench_compose_table_creation(c: &mut Criterion) { - let mut group = c.benchmark_group("compose/table_creation"); - let locale = COMPOSE_LOCALE; - - // ── wkb ──────────────────────────────────────────────────────────── - group.bench_function("wkb", |b| { - b.iter(|| { - let resolved = xkb_core::compose::resolve_compose_file(black_box(locale)); - if let Some(subpath) = resolved { - let path = std::path::Path::new("/usr/share/X11/locale").join(&subpath); - let composer = wkb::testing::compose_parse::load_compose_from_path(&path); - black_box(composer); - } - }); - }); - - // ── xkbcommon (linked) ───────────────────────────────────────────── - group.bench_function("xkbcommon", |b| { - use xkbcommon::xkb; - let ctx = xkb::Context::new(xkb::CONTEXT_NO_FLAGS); - let locale_os = std::ffi::OsStr::new(locale); - b.iter(|| { - let table = xkb::compose::Table::new_from_locale( - &ctx, - locale_os, - xkb::compose::COMPILE_NO_FLAGS, - ); - let _ = black_box(table); - }); - }); - - // ── xkbcommon-dl ─────────────────────────────────────────────────── - group.bench_function("xkbcommon-dl", |b| { - let xkb = xkbcommon_dl::xkbcommon_handle(); - let xkb_compose = xkbcommon_dl::xkbcommon_compose_handle(); - let ctx = - unsafe { (xkb.xkb_context_new)(xkbcommon_dl::xkb_context_flags::XKB_CONTEXT_NO_FLAGS) }; - let c_locale = CString::new(locale).unwrap(); - b.iter(|| { - let table = unsafe { - (xkb_compose.xkb_compose_table_new_from_locale)( - ctx, - c_locale.as_ptr(), - xkbcommon_dl::xkb_compose_compile_flags::XKB_COMPOSE_COMPILE_NO_FLAGS, - ) - }; - black_box(table); - if !table.is_null() { - unsafe { (xkb_compose.xkb_compose_table_unref)(table) }; - } - }); - unsafe { (xkb.xkb_context_unref)(ctx) }; - }); - - // ── xkbcommon-compat ─────────────────────────────────────────────── - group.bench_function("xkbcommon-compat", |b| { - b.iter(|| { - let table = xkb_core::compose::ComposeTable::new_from_locale(black_box(locale)); - black_box(table); - }); - }); - - group.finish(); -} - -fn bench_compose_state_creation(c: &mut Criterion) { - let mut group = c.benchmark_group("compose/state_creation"); - let locale = COMPOSE_LOCALE; - - // ── wkb ──────────────────────────────────────────────────────────── - { - let resolved = xkb_core::compose::resolve_compose_file(locale); - let path = resolved.map(|s| { - std::path::Path::new("/usr/share/X11/locale") - .join(&s) - .to_path_buf() - }); - group.bench_function("wkb", |b| { - b.iter(|| { - if let Some(ref p) = path { - let composer = wkb::testing::compose_parse::load_compose_from_path(p); - black_box(composer); - } - }); - }); - } - - // ── xkbcommon ────────────────────────────────────────────────────── - { - use xkbcommon::xkb; - let ctx = xkb::Context::new(xkb::CONTEXT_NO_FLAGS); - let locale_os = std::ffi::OsStr::new(locale); - let table = - xkb::compose::Table::new_from_locale(&ctx, locale_os, xkb::compose::COMPILE_NO_FLAGS) - .expect("compose table"); - group.bench_function("xkbcommon", |b| { - b.iter(|| { - let state = xkb::compose::State::new(&table, xkb::compose::STATE_NO_FLAGS); - black_box(state); - }); - }); - } - - // ── xkbcommon-dl ─────────────────────────────────────────────────── - { - let xkb = xkbcommon_dl::xkbcommon_handle(); - let xkb_compose = xkbcommon_dl::xkbcommon_compose_handle(); - let ctx = - unsafe { (xkb.xkb_context_new)(xkbcommon_dl::xkb_context_flags::XKB_CONTEXT_NO_FLAGS) }; - let c_locale = CString::new(locale).unwrap(); - let table = unsafe { - (xkb_compose.xkb_compose_table_new_from_locale)( - ctx, - c_locale.as_ptr(), - xkbcommon_dl::xkb_compose_compile_flags::XKB_COMPOSE_COMPILE_NO_FLAGS, - ) - }; - group.bench_function("xkbcommon-dl", |b| { - b.iter(|| { - let state = unsafe { - (xkb_compose.xkb_compose_state_new)( - table, - xkbcommon_dl::xkb_compose_state_flags::XKB_COMPOSE_STATE_NO_FLAGS, - ) - }; - black_box(state); - if !state.is_null() { - unsafe { (xkb_compose.xkb_compose_state_unref)(state) }; - } - }); - }); - unsafe { - (xkb_compose.xkb_compose_table_unref)(table); - (xkb.xkb_context_unref)(ctx); - }; - } - - // ── xkbcommon-compat ─────────────────────────────────────────────── - { - let table = xkb_core::compose::ComposeTable::new_from_locale(locale) - .expect("xkb-core compose table"); - group.bench_function("xkbcommon-compat", |b| { - b.iter(|| { - let state = table.new_state(); - black_box(state); - }); - }); - } - - group.finish(); -} - -fn bench_compose_feed(c: &mut Criterion) { - let mut group = c.benchmark_group("compose/feed"); - - for seq in COMPOSE_SEQUENCES { - // ── wkb ──────────────────────────────────────────────────────── - { - let resolved = xkb_core::compose::resolve_compose_file(COMPOSE_LOCALE); - let path = resolved.map(|s| { - std::path::Path::new("/usr/share/X11/locale") - .join(&s) - .to_path_buf() - }); - if let Some(ref p) = path { - let mut composer = wkb::testing::compose_parse::load_compose_from_path(p); - use wkb::testing::Composer; - // Pre-convert keysyms to tokens outside the benchmark loop - let tokens: Vec = seq - .keysyms - .iter() - .filter_map(|&ks| { - xkb_core::keysym_utf::keysym_to_char(ks).map(wkb::testing::Token::Char) - }) - .collect(); - group.bench_with_input(BenchmarkId::new("wkb", seq.name), &tokens, |b, tokens| { - b.iter(|| { - for token in tokens { - black_box(composer.feed(*token)); - } - }); - }); - } - } - - // ── xkbcommon ────────────────────────────────────────────────── - { - use xkbcommon::xkb; - let ctx = xkb::Context::new(xkb::CONTEXT_NO_FLAGS); - let locale_os = std::ffi::OsStr::new(COMPOSE_LOCALE); - if let Ok(table) = xkb::compose::Table::new_from_locale( - &ctx, - locale_os, - xkb::compose::COMPILE_NO_FLAGS, - ) { - let mut state = xkb::compose::State::new(&table, xkb::compose::STATE_NO_FLAGS); - group.bench_with_input( - BenchmarkId::new("xkbcommon", seq.name), - &seq.keysyms, - |b, keysyms| { - b.iter(|| { - for &ks in *keysyms { - black_box(state.feed(xkb::Keysym::new(ks))); - } - state.reset(); - }); - }, - ); - } - } - - // ── xkbcommon-dl ─────────────────────────────────────────────── - { - let xkb = xkbcommon_dl::xkbcommon_handle(); - let xkb_compose = xkbcommon_dl::xkbcommon_compose_handle(); - let ctx = unsafe { - (xkb.xkb_context_new)(xkbcommon_dl::xkb_context_flags::XKB_CONTEXT_NO_FLAGS) - }; - let c_locale = CString::new(COMPOSE_LOCALE).unwrap(); - let table = unsafe { - (xkb_compose.xkb_compose_table_new_from_locale)( - ctx, - c_locale.as_ptr(), - xkbcommon_dl::xkb_compose_compile_flags::XKB_COMPOSE_COMPILE_NO_FLAGS, - ) - }; - if !table.is_null() { - let state = unsafe { - (xkb_compose.xkb_compose_state_new)( - table, - xkbcommon_dl::xkb_compose_state_flags::XKB_COMPOSE_STATE_NO_FLAGS, - ) - }; - group.bench_with_input( - BenchmarkId::new("xkbcommon-dl", seq.name), - &seq.keysyms, - |b, keysyms| { - b.iter(|| { - for &ks in *keysyms { - black_box(unsafe { - (xkb_compose.xkb_compose_state_feed)(state, ks) - }); - } - unsafe { (xkb_compose.xkb_compose_state_reset)(state) }; - }); - }, - ); - unsafe { - (xkb_compose.xkb_compose_state_unref)(state); - (xkb_compose.xkb_compose_table_unref)(table); - (xkb.xkb_context_unref)(ctx); - }; - } - } - - // ── xkbcommon-compat ─────────────────────────────────────────── - { - if let Some(table) = xkb_core::compose::ComposeTable::new_from_locale(COMPOSE_LOCALE) { - let mut state = table.new_state(); - group.bench_with_input( - BenchmarkId::new("xkbcommon-compat", seq.name), - &seq.keysyms, - |b, keysyms| { - b.iter(|| { - for &ks in *keysyms { - black_box(state.feed(ks)); - } - state.reset(); - }); - }, - ); - } - } - } - - group.finish(); -} - -// ════════════════════════════════════════════════════════════════════════ -// 2. KEY PRESS BENCHMARKS -// ════════════════════════════════════════════════════════════════════════ - -/// Helper: set up wkb for a given layout. -fn wkb_setup(locale: &str, variant: Option<&str>) -> wkb::WKB { - let layout = variant.map(String::from); - wkb::WKB::new_from_names(locale.to_string(), layout) -} - -/// Helper: set up xkbcommon context + keymap + state. -fn xkbcommon_setup( - locale: &str, - variant: Option<&str>, -) -> ( - xkbcommon::xkb::Context, - xkbcommon::xkb::Keymap, - xkbcommon::xkb::State, -) { - use xkbcommon::xkb; - let ctx = xkb::Context::new(xkb::CONTEXT_NO_FLAGS); - let km = xkb::Keymap::new_from_names( - &ctx, - "evdev", - "", - locale, - variant.unwrap_or(""), - None, - xkb::KEYMAP_COMPILE_NO_FLAGS, - ) - .expect("xkbcommon keymap"); - let st = xkb::State::new(&km); - (ctx, km, st) -} - -/// Helper: set up xkbcommon-dl context + keymap + state. -fn xkbcommon_dl_setup( - locale: &str, - variant: Option<&str>, -) -> ( - &'static xkbcommon_dl::XkbCommon, - *mut xkbcommon_dl::xkb_context, - *mut xkbcommon_dl::xkb_keymap, - *mut xkbcommon_dl::xkb_state, -) { - let xkb = xkbcommon_dl::xkbcommon_handle(); - let ctx = - unsafe { (xkb.xkb_context_new)(xkbcommon_dl::xkb_context_flags::XKB_CONTEXT_NO_FLAGS) }; - let c_rules = CString::new("evdev").unwrap(); - let c_layout = CString::new(locale).unwrap(); - let c_variant = variant.map(|v| CString::new(v).unwrap()); - let names = xkbcommon_dl::xkb_rule_names { - rules: c_rules.as_ptr(), - model: ptr::null(), - layout: c_layout.as_ptr(), - variant: c_variant.as_ref().map_or(ptr::null(), |v| v.as_ptr()), - options: ptr::null(), - }; - let km = unsafe { - (xkb.xkb_keymap_new_from_names)( - ctx, - &names, - xkbcommon_dl::xkb_keymap_compile_flags::XKB_KEYMAP_COMPILE_NO_FLAGS, - ) - }; - let st = unsafe { (xkb.xkb_state_new)(km) }; - (xkb, ctx, km, st) -} - -fn bench_key_update(c: &mut Criterion) { - let mut group = c.benchmark_group("key/update"); - - for &(locale, variant) in LAYOUTS { - let layout_id = variant.map_or(locale.to_string(), |v| format!("{locale}_{v}")); - - for case in KEY_CASES { - let bench_id = format!("{layout_id}/{}", case.name); - - // ── wkb ──────────────────────────────────────────────────── - { - let mut wb = wkb_setup(locale, variant); - group.bench_function(BenchmarkId::new("wkb", &bench_id), |b| { - b.iter(|| { - for &(code, down) in case.keys { - let dir = if down { - KeyDirection::Down - } else { - KeyDirection::Up - }; - black_box(wb.update_key(black_box(code), dir)); - } - }); - }); - } - - // ── xkbcommon ────────────────────────────────────────────── - { - use xkbcommon::xkb; - let (_ctx, _km, mut st) = xkbcommon_setup(locale, variant); - group.bench_function(BenchmarkId::new("xkbcommon", &bench_id), |b| { - b.iter(|| { - for &(code, down) in case.keys { - let xkb_kc = xkb::Keycode::new(code + EVDEV_OFFSET); - let dir = if down { - xkb::KeyDirection::Down - } else { - xkb::KeyDirection::Up - }; - black_box(st.update_key(xkb_kc, dir)); - } - }); - }); - } - - // ── xkbcommon-dl ─────────────────────────────────────────── - { - let (xkb, ctx, km, st) = xkbcommon_dl_setup(locale, variant); - group.bench_function(BenchmarkId::new("xkbcommon-dl", &bench_id), |b| { - b.iter(|| { - for &(code, down) in case.keys { - let xkb_kc = code + EVDEV_OFFSET; - let dir = if down { - xkbcommon_dl::xkb_key_direction::XKB_KEY_DOWN - } else { - xkbcommon_dl::xkb_key_direction::XKB_KEY_UP - }; - black_box(unsafe { (xkb.xkb_state_update_key)(st, xkb_kc, dir) }); - } - }); - }); - unsafe { - (xkb.xkb_state_unref)(st); - (xkb.xkb_keymap_unref)(km); - (xkb.xkb_context_unref)(ctx); - } - } - - // ── xkbcommon-compat ─────────────────────────────────────── - { - let (_km, mut st) = compat_setup(locale, variant); - group.bench_function(BenchmarkId::new("xkbcommon-compat", &bench_id), |b| { - b.iter(|| { - for &(code, down) in case.keys { - let xkb_kc = code + EVDEV_OFFSET; - let dir = if down { - xkb_core::XKB_KEY_DOWN - } else { - xkb_core::XKB_KEY_UP - }; - black_box(st.update_key(xkb_kc, dir)); - } - }); - }); - } - } - } - group.finish(); -} - -fn bench_key_get_sym(c: &mut Criterion) { - let mut group = c.benchmark_group("key/get_sym"); - - for &(locale, variant) in LAYOUTS { - let layout_id = variant.map_or(locale.to_string(), |v| format!("{locale}_{v}")); - - for case in KEY_CASES { - let bench_id = format!("{layout_id}/{}", case.name); - - // ── wkb ──────────────────────────────────────────────────── - { - let mut wb = wkb_setup(locale, variant); - group.bench_function(BenchmarkId::new("wkb", &bench_id), |b| { - b.iter(|| { - for &(code, down) in case.keys { - let dir = if down { - KeyDirection::Down - } else { - KeyDirection::Up - }; - wb.update_key(code, dir); - if down { - black_box(wb.utf8(black_box(code))); - } - } - }); - }); - } - - // ── xkbcommon ────────────────────────────────────────────── - { - use xkbcommon::xkb; - let (_ctx, _km, mut st) = xkbcommon_setup(locale, variant); - group.bench_function(BenchmarkId::new("xkbcommon", &bench_id), |b| { - b.iter(|| { - for &(code, down) in case.keys { - let xkb_kc = xkb::Keycode::new(code + EVDEV_OFFSET); - let dir = if down { - xkb::KeyDirection::Down - } else { - xkb::KeyDirection::Up - }; - st.update_key(xkb_kc, dir); - if down { - black_box(st.key_get_one_sym(black_box(xkb_kc))); - } - } - }); - }); - } - - // ── xkbcommon-dl ─────────────────────────────────────────── - { - let (xkb, ctx, km, st) = xkbcommon_dl_setup(locale, variant); - group.bench_function(BenchmarkId::new("xkbcommon-dl", &bench_id), |b| { - b.iter(|| { - for &(code, down) in case.keys { - let xkb_kc = code + EVDEV_OFFSET; - let dir = if down { - xkbcommon_dl::xkb_key_direction::XKB_KEY_DOWN - } else { - xkbcommon_dl::xkb_key_direction::XKB_KEY_UP - }; - unsafe { (xkb.xkb_state_update_key)(st, xkb_kc, dir) }; - if down { - black_box(unsafe { - (xkb.xkb_state_key_get_one_sym)(st, black_box(xkb_kc)) - }); - } - } - }); - }); - unsafe { - (xkb.xkb_state_unref)(st); - (xkb.xkb_keymap_unref)(km); - (xkb.xkb_context_unref)(ctx); - } - } - - // ── xkbcommon-compat ─────────────────────────────────────── - { - let (_km, mut st) = compat_setup(locale, variant); - group.bench_function(BenchmarkId::new("xkbcommon-compat", &bench_id), |b| { - b.iter(|| { - for &(code, down) in case.keys { - let xkb_kc = code + EVDEV_OFFSET; - let dir = if down { - xkb_core::XKB_KEY_DOWN - } else { - xkb_core::XKB_KEY_UP - }; - st.update_key(xkb_kc, dir); - if down { - black_box(st.key_get_one_sym(black_box(xkb_kc))); - } - } - }); - }); - } - } - } - group.finish(); -} - -fn bench_key_get_utf8(c: &mut Criterion) { - let mut group = c.benchmark_group("key/get_utf8"); - - for &(locale, variant) in LAYOUTS { - let layout_id = variant.map_or(locale.to_string(), |v| format!("{locale}_{v}")); - - for case in KEY_CASES { - let bench_id = format!("{layout_id}/{}", case.name); - - // ── wkb ──────────────────────────────────────────────────── - { - let mut wb = wkb_setup(locale, variant); - group.bench_function(BenchmarkId::new("wkb", &bench_id), |b| { - b.iter(|| { - for &(code, down) in case.keys { - let dir = if down { - KeyDirection::Down - } else { - KeyDirection::Up - }; - wb.update_key(code, dir); - if down { - black_box(wb.utf8(black_box(code))); - } - } - }); - }); - } - - // ── xkbcommon ────────────────────────────────────────────── - { - use xkbcommon::xkb; - let (_ctx, _km, mut st) = xkbcommon_setup(locale, variant); - group.bench_function(BenchmarkId::new("xkbcommon", &bench_id), |b| { - b.iter(|| { - for &(code, down) in case.keys { - let xkb_kc = xkb::Keycode::new(code + EVDEV_OFFSET); - let dir = if down { - xkb::KeyDirection::Down - } else { - xkb::KeyDirection::Up - }; - st.update_key(xkb_kc, dir); - if down { - black_box(st.key_get_utf8(black_box(xkb_kc))); - } - } - }); - }); - } - - // ── xkbcommon-dl ─────────────────────────────────────────── - { - let (xkb, ctx, km, st) = xkbcommon_dl_setup(locale, variant); - let mut buf = [0u8; 64]; - group.bench_function(BenchmarkId::new("xkbcommon-dl", &bench_id), |b| { - b.iter(|| { - for &(code, down) in case.keys { - let xkb_kc = code + EVDEV_OFFSET; - let dir = if down { - xkbcommon_dl::xkb_key_direction::XKB_KEY_DOWN - } else { - xkbcommon_dl::xkb_key_direction::XKB_KEY_UP - }; - unsafe { (xkb.xkb_state_update_key)(st, xkb_kc, dir) }; - if down { - black_box(unsafe { - (xkb.xkb_state_key_get_utf8)( - st, - black_box(xkb_kc), - buf.as_mut_ptr() as *mut c_char, - buf.len(), - ) - }); - } - } - }); - }); - unsafe { - (xkb.xkb_state_unref)(st); - (xkb.xkb_keymap_unref)(km); - (xkb.xkb_context_unref)(ctx); - } - } - - // ── xkbcommon-compat ─────────────────────────────────────── - { - let (_km, mut st) = compat_setup(locale, variant); - group.bench_function(BenchmarkId::new("xkbcommon-compat", &bench_id), |b| { - b.iter(|| { - for &(code, down) in case.keys { - let xkb_kc = code + EVDEV_OFFSET; - let dir = if down { - xkb_core::XKB_KEY_DOWN - } else { - xkb_core::XKB_KEY_UP - }; - st.update_key(xkb_kc, dir); - if down { - black_box(st.key_get_utf8(black_box(xkb_kc))); - } - } - }); - }); - } - } - } - group.finish(); -} - -// ════════════════════════════════════════════════════════════════════════ -// 4. FULL SETUP BENCHMARKS — total cost from zero to ready-to-use -// ════════════════════════════════════════════════════════════════════════ - -fn bench_full_setup(c: &mut Criterion) { - let mut group = c.benchmark_group("full_setup"); - group.sample_size(10); - group.measurement_time(Duration::from_secs(2)); - let locale = "us"; - - // ── wkb: new_from_names builds keymap + flat tables + compose in one call - group.bench_function("wkb", |b| { - b.iter(|| { - let wkb = wkb_setup(black_box(locale), None); - black_box(wkb); - }); - }); - - // ── xkbcommon: context + keymap + state + compose_table + compose_state - group.bench_function("xkbcommon", |b| { - use xkbcommon::xkb; - b.iter(|| { - let ctx = xkb::Context::new(xkb::CONTEXT_NO_FLAGS); - let km = xkb::Keymap::new_from_names( - &ctx, - "evdev", - "", - black_box(locale), - "", - None, - xkb::KEYMAP_COMPILE_NO_FLAGS, - ) - .expect("keymap"); - let st = xkb::State::new(&km); - let locale_os = std::ffi::OsStr::new(COMPOSE_LOCALE); - let table = xkb::compose::Table::new_from_locale( - &ctx, - locale_os, - xkb::compose::COMPILE_NO_FLAGS, - ); - let compose_state = table - .as_ref() - .map(|t| xkb::compose::State::new(t, xkb::compose::STATE_NO_FLAGS)); - black_box(&table); - let _ = black_box((ctx, km, st, compose_state)); - }); - }); - - // ── xkbcommon-dl: same via dlopen - group.bench_function("xkbcommon-dl", |b| { - let xkb = xkbcommon_dl::xkbcommon_handle(); - let xkb_compose = xkbcommon_dl::xkbcommon_compose_handle(); - let c_locale = CString::new(COMPOSE_LOCALE).unwrap(); - b.iter(|| { - let ctx = unsafe { - (xkb.xkb_context_new)(xkbcommon_dl::xkb_context_flags::XKB_CONTEXT_NO_FLAGS) - }; - let rmlvo = xkbcommon_dl::xkb_rule_names { - rules: c"evdev".as_ptr(), - model: ptr::null(), - layout: c"us".as_ptr(), - variant: ptr::null(), - options: ptr::null(), - }; - let km = unsafe { - (xkb.xkb_keymap_new_from_names)( - ctx, - &rmlvo, - xkbcommon_dl::xkb_keymap_compile_flags::XKB_KEYMAP_COMPILE_NO_FLAGS, - ) - }; - let st = unsafe { (xkb.xkb_state_new)(km) }; - let table = unsafe { - (xkb_compose.xkb_compose_table_new_from_locale)( - ctx, - c_locale.as_ptr(), - xkbcommon_dl::xkb_compose_compile_flags::XKB_COMPOSE_COMPILE_NO_FLAGS, - ) - }; - let cs = if !table.is_null() { - unsafe { - (xkb_compose.xkb_compose_state_new)( - table, - xkbcommon_dl::xkb_compose_state_flags::XKB_COMPOSE_STATE_NO_FLAGS, - ) - } - } else { - ptr::null_mut() - }; - black_box((ctx, km, st, table, cs)); - // Cleanup - if !cs.is_null() { - unsafe { (xkb_compose.xkb_compose_state_unref)(cs) }; - } - if !table.is_null() { - unsafe { (xkb_compose.xkb_compose_table_unref)(table) }; - } - unsafe { - (xkb.xkb_state_unref)(st); - (xkb.xkb_keymap_unref)(km); - (xkb.xkb_context_unref)(ctx); - } - }); - }); - - // ── xkbcommon-compat: xkb-core Rust API - group.bench_function("xkbcommon-compat", |b| { - b.iter(|| { - let (km, st) = compat_setup(black_box(locale), None); - let table = xkb_core::compose::ComposeTable::new_from_locale(black_box(COMPOSE_LOCALE)); - let cs = table.as_ref().map(|t| t.new_state()); - black_box(&table); - black_box((km, st, cs)); - }); - }); - - group.finish(); -} - -// ════════════════════════════════════════════════════════════════════════ -// CRITERION ENTRY -// ════════════════════════════════════════════════════════════════════════ - -criterion_group! { - name = benches; - config = fast(); - targets = - bench_full_setup, - bench_compose_table_creation, - bench_compose_state_creation, - bench_compose_feed, - bench_key_update, - bench_key_get_sym, - bench_key_get_utf8, -} -criterion_main!(benches); diff --git a/benches/common.rs b/benches/common.rs index ca1e0767..9f269b1a 100644 --- a/benches/common.rs +++ b/benches/common.rs @@ -1,9 +1,15 @@ /// Shared constants and test matrix for all benchmarks. /// /// Evdev keycodes used across benchmarks (all backends add +8 for XKB keycodes). -/// Layout cases cover plain, shift, caps-lock, AltGr/level3, numlock variants. // ── Locales & layouts ────────────────────────────────────────────────── +/// Primary layout — used for all key cases. +pub const PRIMARY_LAYOUT: (&str, Option<&str>) = ("us", None); + +/// Extra layouts — only tested with layout-sensitive cases (AltGr, punctuation). +pub const EXTRA_LAYOUTS: &[(&str, Option<&str>)] = &[("de", None), ("us", Some("intl"))]; + +/// All layouts combined — used by example binaries (memory/size benchmarks). pub const LAYOUTS: &[(&str, Option<&str>)] = &[ ("us", None), ("de", None), @@ -12,51 +18,47 @@ pub const LAYOUTS: &[(&str, Option<&str>)] = &[ ("us", Some("intl")), ]; +/// Number of repeated key-presses for memory/size benchmark workloads. +pub const HOT_PATH_ITERATIONS: usize = 100; + +/// Cases that produce different results across layouts (AltGr, punctuation, etc.) +pub const LAYOUT_SENSITIVE_CASES: &[&str] = &["altgr_e", "semicolon", "shift_1", "plain_a"]; + // ── Evdev key codes ──────────────────────────────────────────────────── pub const KEY_A: u32 = 30; pub const KEY_B: u32 = 48; pub const KEY_Z: u32 = 44; pub const KEY_1: u32 = 2; pub const KEY_SPACE: u32 = 57; -pub const KEY_ENTER: u32 = 28; pub const KEY_LEFT_SHIFT: u32 = 42; pub const KEY_RIGHT_SHIFT: u32 = 54; pub const KEY_CAPS_LOCK: u32 = 58; pub const KEY_LEFT_ALT: u32 = 56; -pub const KEY_RIGHT_ALT: u32 = 100; // AltGr on intl layouts +pub const KEY_RIGHT_ALT: u32 = 100; pub const KEY_NUM_LOCK: u32 = 69; -pub const KEY_KP_1: u32 = 79; pub const KEY_KP_5: u32 = 76; pub const KEY_LEFT_CTRL: u32 = 29; -pub const KEY_TAB: u32 = 15; pub const KEY_E: u32 = 18; -pub const KEY_O: u32 = 24; -pub const KEY_U: u32 = 22; +pub const KEY_F1: u32 = 59; pub const KEY_SEMICOLON: u32 = 39; -pub const KEY_APOSTROPHE: u32 = 40; -pub const KEY_COMMA: u32 = 51; +pub const KEY_TAB: u32 = 15; +pub const KEY_SCROLL_LOCK: u32 = 70; pub const EVDEV_OFFSET: u32 = 8; /// A named key-press scenario: (name, sequence of (evdev_code, is_down)). -/// `is_down == true` means press, `false` means release. pub struct KeyCase { pub name: &'static str, pub keys: &'static [(u32, bool)], } -/// All modifier/key combinations to benchmark. +/// Key cases covering hot paths and edge paths. pub const KEY_CASES: &[KeyCase] = &[ - // Plain keys + // ── Hot paths ────────────────────────────────────────────────────── KeyCase { name: "plain_a", keys: &[(KEY_A, true), (KEY_A, false)], }, - KeyCase { - name: "plain_space", - keys: &[(KEY_SPACE, true), (KEY_SPACE, false)], - }, - // Shift + key KeyCase { name: "shift_a", keys: &[ @@ -66,7 +68,22 @@ pub const KEY_CASES: &[KeyCase] = &[ (KEY_LEFT_SHIFT, false), ], }, - // Caps Lock + key + KeyCase { + name: "rapid_typing", + keys: &[ + (KEY_A, true), + (KEY_A, false), + (KEY_B, true), + (KEY_B, false), + (KEY_Z, true), + (KEY_Z, false), + (KEY_1, true), + (KEY_1, false), + (KEY_SPACE, true), + (KEY_SPACE, false), + ], + }, + // ── Modifier toggles ─────────────────────────────────────────────── KeyCase { name: "caps_a", keys: &[ @@ -74,12 +91,10 @@ pub const KEY_CASES: &[KeyCase] = &[ (KEY_CAPS_LOCK, false), (KEY_A, true), (KEY_A, false), - // toggle caps off (KEY_CAPS_LOCK, true), (KEY_CAPS_LOCK, false), ], }, - // AltGr / Level3 (evdev 100 = Right Alt = AltGr on intl) KeyCase { name: "altgr_e", keys: &[ @@ -89,7 +104,6 @@ pub const KEY_CASES: &[KeyCase] = &[ (KEY_RIGHT_ALT, false), ], }, - // NumLock + keypad KeyCase { name: "numlock_kp5", keys: &[ @@ -97,32 +111,79 @@ pub const KEY_CASES: &[KeyCase] = &[ (KEY_NUM_LOCK, false), (KEY_KP_5, true), (KEY_KP_5, false), - // toggle numlock off (KEY_NUM_LOCK, true), (KEY_NUM_LOCK, false), ], }, - // Rapid typing: a b z 1 space + // ── Edge paths ───────────────────────────────────────────────────── KeyCase { - name: "rapid_typing", + name: "ctrl_a", keys: &[ + (KEY_LEFT_CTRL, true), (KEY_A, true), (KEY_A, false), - (KEY_B, true), - (KEY_B, false), - (KEY_Z, true), - (KEY_Z, false), + (KEY_LEFT_CTRL, false), + ], + }, + KeyCase { + name: "ctrl_shift_a", + keys: &[ + (KEY_LEFT_CTRL, true), + (KEY_LEFT_SHIFT, true), + (KEY_A, true), + (KEY_A, false), + (KEY_LEFT_SHIFT, false), + (KEY_LEFT_CTRL, false), + ], + }, + KeyCase { + name: "f1", + keys: &[(KEY_F1, true), (KEY_F1, false)], + }, + KeyCase { + name: "caps_shift_a", + keys: &[ + (KEY_CAPS_LOCK, true), + (KEY_CAPS_LOCK, false), + (KEY_LEFT_SHIFT, true), + (KEY_A, true), + (KEY_A, false), + (KEY_LEFT_SHIFT, false), + (KEY_CAPS_LOCK, true), + (KEY_CAPS_LOCK, false), + ], + }, + KeyCase { + name: "shift_1", + keys: &[ + (KEY_LEFT_SHIFT, true), (KEY_1, true), (KEY_1, false), - (KEY_SPACE, true), - (KEY_SPACE, false), + (KEY_LEFT_SHIFT, false), + ], + }, + KeyCase { + name: "semicolon", + keys: &[(KEY_SEMICOLON, true), (KEY_SEMICOLON, false)], + }, + KeyCase { + name: "rapid_modifiers", + keys: &[ + (KEY_LEFT_SHIFT, true), + (KEY_LEFT_SHIFT, false), + (KEY_LEFT_CTRL, true), + (KEY_LEFT_CTRL, false), + (KEY_LEFT_ALT, true), + (KEY_LEFT_ALT, false), + (KEY_CAPS_LOCK, true), + (KEY_CAPS_LOCK, false), + (KEY_NUM_LOCK, true), + (KEY_NUM_LOCK, false), ], }, ]; /// Compose sequences to benchmark. -/// Each is a series of keysyms (u32) that form a compose sequence. -/// These are standard X11 compose sequences for en_US.UTF-8. pub struct ComposeSequence { pub name: &'static str, pub keysyms: &'static [u32], @@ -130,63 +191,64 @@ pub struct ComposeSequence { } // Keysym constants for compose sequences -pub const XKB_KEY_MULTI_KEY: u32 = 0xff20; // Multi_key / Compose -pub const XKB_KEY_ACUTE: u32 = 0x00b4; // acute accent +pub const XKB_KEY_MULTI_KEY: u32 = 0xff20; pub const XKB_KEY_APOSTROPHE: u32 = 0x0027; -pub const XKB_KEY_A_LOWER: u32 = 0x0061; // 'a' -pub const XKB_KEY_E_LOWER: u32 = 0x0065; // 'e' -pub const XKB_KEY_O_LOWER: u32 = 0x006f; // 'o' -pub const XKB_KEY_U_LOWER: u32 = 0x0075; // 'u' -pub const XKB_KEY_QUOTEDBL: u32 = 0x0022; // '"' -pub const XKB_KEY_ASCIITILDE: u32 = 0x007e; // '~' -pub const XKB_KEY_N_LOWER: u32 = 0x006e; // 'n' -pub const XKB_KEY_SLASH: u32 = 0x002f; // '/' -pub const XKB_KEY_EQUAL: u32 = 0x003d; // '=' -pub const XKB_KEY_S_LOWER: u32 = 0x0073; // 's' -pub const XKB_KEY_LESS: u32 = 0x003c; // '<' -pub const XKB_KEY_3: u32 = 0x0033; // '3' +pub const XKB_KEY_E_LOWER: u32 = 0x0065; +pub const XKB_KEY_U_LOWER: u32 = 0x0075; +pub const XKB_KEY_QUOTEDBL: u32 = 0x0022; +pub const XKB_KEY_ASCIITILDE: u32 = 0x007e; +pub const XKB_KEY_N_LOWER: u32 = 0x006e; +pub const XKB_KEY_SLASH: u32 = 0x002f; +pub const XKB_KEY_EQUAL: u32 = 0x003d; +pub const XKB_KEY_S_LOWER: u32 = 0x0073; +pub const XKB_KEY_LESS: u32 = 0x003c; +pub const XKB_KEY_3: u32 = 0x0033; +pub const XKB_KEY_O_LOWER: u32 = 0x006f; +pub const XKB_KEY_A_LOWER: u32 = 0x0061; +pub const XKB_KEY_ASCIICIRCUM: u32 = 0x005e; +pub const XKB_KEY_C_LOWER: u32 = 0x0063; pub const COMPOSE_SEQUENCES: &[ComposeSequence] = &[ - // Compose + ' + e → é ComposeSequence { - name: "compose_acute_e", + name: "acute_e", keysyms: &[XKB_KEY_MULTI_KEY, XKB_KEY_APOSTROPHE, XKB_KEY_E_LOWER], expected_char: Some('é'), }, - // Compose + " + u → ü ComposeSequence { - name: "compose_diaeresis_u", + name: "diaeresis_u", keysyms: &[XKB_KEY_MULTI_KEY, XKB_KEY_QUOTEDBL, XKB_KEY_U_LOWER], expected_char: Some('ü'), }, - // Compose + ~ + n → ñ ComposeSequence { - name: "compose_tilde_n", + name: "tilde_n", keysyms: &[XKB_KEY_MULTI_KEY, XKB_KEY_ASCIITILDE, XKB_KEY_N_LOWER], expected_char: Some('ñ'), }, - // Compose + / + = → ≠ (may not exist in all tables) - ComposeSequence { - name: "compose_slash_equal", - keysyms: &[XKB_KEY_MULTI_KEY, XKB_KEY_SLASH, XKB_KEY_EQUAL], - expected_char: None, // varies by locale - }, - // Compose + s + s → ß ComposeSequence { - name: "compose_ss", + name: "ss", keysyms: &[XKB_KEY_MULTI_KEY, XKB_KEY_S_LOWER, XKB_KEY_S_LOWER], expected_char: Some('ß'), }, - // Compose + < + 3 → ♥ ComposeSequence { - name: "compose_heart", + name: "heart", keysyms: &[XKB_KEY_MULTI_KEY, XKB_KEY_LESS, XKB_KEY_3], expected_char: Some('♥'), }, + // Edge: circumflex + vowels + ComposeSequence { + name: "circumflex_o", + keysyms: &[XKB_KEY_MULTI_KEY, XKB_KEY_ASCIICIRCUM, XKB_KEY_O_LOWER], + expected_char: Some('ô'), + }, + // Edge: cedilla + ComposeSequence { + name: "cedilla_c", + keysyms: &[XKB_KEY_MULTI_KEY, XKB_KEY_COMMA, XKB_KEY_C_LOWER], + expected_char: Some('ç'), + }, ]; +pub const XKB_KEY_COMMA: u32 = 0x002c; + /// Fixed locale for compose benchmarks. pub const COMPOSE_LOCALE: &str = "en_US.UTF-8"; - -/// Number of repeated key-presses for hot-path benchmarks. -pub const HOT_PATH_ITERATIONS: usize = 100; diff --git a/scripts/generate_benchmark_table.js b/scripts/generate_benchmark_table.js index 4258c688..21523ac5 100644 --- a/scripts/generate_benchmark_table.js +++ b/scripts/generate_benchmark_table.js @@ -59,9 +59,9 @@ function generateSpeedTable() { const groups = fs.readdirSync(CRITERION_DIR) .filter(d => !d.startsWith('.') && d !== 'report'); - // Focus on key benchmark groups - const interesting = ['full_setup', 'key_update', 'key_get_utf8', 'key_get_sym', - 'compose_table_creation', 'compose_feed']; + // Focus on key benchmark groups (criterion uses '/' as dir separator) + const interesting = ['full_setup', 'key/update', 'key/get_utf8', 'key/get_sym', + 'compose/table_creation', 'compose/state_creation', 'compose/feed']; const rows = []; for (const group of interesting) { @@ -149,7 +149,7 @@ function generateFullSection(memOutput, sizeOutput) { if (sizeOutput) { const sizeTable = generateSizeTable(sizeOutput); - if (sizeTable) section += '### Binary Size\n\n' + sizeTable + '\n'; + if (sizeTable) section += '### Binary Size\n\nSizes for xkbcommon and xkbcommon-dl include the dynamically-linked `libxkbcommon.so`.\n\n' + sizeTable + '\n'; } return section; diff --git a/src/xkb.rs b/src/xkb.rs index 30e05907..91a56d58 100644 --- a/src/xkb.rs +++ b/src/xkb.rs @@ -154,7 +154,13 @@ fn build_wkb_from_keymap( const EVDEV_OFFSET: u32 = 8; let (min_keycode, max_keycode) = (keymap.min_keycode(), keymap.max_keycode()); - let num_keys = (max_keycode - EVDEV_OFFSET + 1) as usize; + // Keycodes below EVDEV_OFFSET don't map to evdev codes; clamp to avoid underflow. + let min_keycode = min_keycode.max(EVDEV_OFFSET); + let num_keys = if max_keycode >= EVDEV_OFFSET { + (max_keycode - EVDEV_OFFSET + 1) as usize + } else { + 0 + }; let modifiers = build_modifiers_from_keymap(keymap, min_keycode, max_keycode); let get_char = |kc: u32, state: &xkb_core::rust_types::State, lvl: usize| -> Option { @@ -373,7 +379,7 @@ fn build_modifiers_from_keymap( .collect(); const EVDEV_OFFSET: u32 = 8; - for keycode in min_keycode..=max_keycode { + for keycode in min_keycode.max(EVDEV_OFFSET)..=max_keycode { let evdev_code = keycode - EVDEV_OFFSET; let syms = keymap.key_get_syms_by_level(keycode, 0, 0); let num_levels = keymap.num_levels_for_key(keycode, 0); diff --git a/tests/compile.rs b/tests/compile.rs new file mode 100644 index 00000000..0ae2b605 --- /dev/null +++ b/tests/compile.rs @@ -0,0 +1,122 @@ +//! kbvm compile-test runner: parse input.xkb with xkbcommon, verify compilation, +//! test round-trip serialization via WKB's `as_xkb_string()`. +//! +//! Test data from https://github.com/mahkoh/kbvm (MIT licensed). +//! +//! For each test: parse with xkbcommon (using include paths), build WKB from +//! xkbcommon's output, serialize with WKB, and verify the result re-parses. + +use std::panic; +use std::path::{Path, PathBuf}; + +const TEST_DATA_DIR: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/test_files"); + +fn collect_xkb_compile_tests() -> Vec { + let base = Path::new(TEST_DATA_DIR).join("compile-tests"); + let mut cases = Vec::new(); + collect_dirs_with_file(&base, "input.xkb", &mut cases); + cases.sort(); + cases +} + +fn collect_dirs_with_file(dir: &Path, filename: &str, out: &mut Vec) { + if dir.join(filename).exists() { + out.push(dir.to_path_buf()); + } + if let Ok(entries) = std::fs::read_dir(dir) { + for entry in entries.flatten() { + let path = entry.path(); + if path.is_dir() { + collect_dirs_with_file(&path, filename, out); + } + } + } +} + +fn case_name(case_dir: &Path) -> String { + case_dir + .strip_prefix(Path::new(TEST_DATA_DIR).join("compile-tests")) + .unwrap_or(case_dir) + .display() + .to_string() +} + +fn run_xkb_compile_test(case_dir: &Path) -> Result<(), String> { + let name = case_name(case_dir); + let input = std::fs::read_to_string(case_dir.join("input.xkb")) + .map_err(|e| format!("{name}: read input.xkb: {e}"))?; + + // Set up xkbcommon context with include paths + let mut ctx = xkbcommon::xkb::Context::new(xkbcommon::xkb::CONTEXT_NO_DEFAULT_INCLUDES); + ctx.include_path_append(case_dir); + ctx.include_path_append(&Path::new(TEST_DATA_DIR).join("compile-include")); + let extra_includes = case_dir.join("extra-includes"); + if extra_includes.is_dir() { + ctx.include_path_append(&extra_includes); + } + + // Parse with xkbcommon + let keymap = xkbcommon::xkb::Keymap::new_from_string( + &ctx, + input, + xkbcommon::xkb::KEYMAP_FORMAT_TEXT_V1, + xkbcommon::xkb::KEYMAP_COMPILE_NO_FLAGS, + ) + .ok_or_else(|| format!("{name}: xkbcommon failed to parse"))?; + + // Build WKB from xkbcommon's fully-expanded keymap + let xkb_str = keymap.get_as_string(xkbcommon::xkb::KEYMAP_FORMAT_TEXT_V1); + let prev_hook = panic::take_hook(); + panic::set_hook(Box::new(|_| {})); + let wkb_result = panic::catch_unwind(|| wkb::WKB::new_from_string(xkb_str)); + panic::set_hook(prev_hook); + let wkb = wkb_result.map_err(|_| format!("{name}: WKB panicked"))?; + + // Round-trip: serialize with WKB and verify xkbcommon can re-parse + let serialized = wkb + .as_xkb_string() + .ok_or_else(|| format!("{name}: WKB serializer returned None"))?; + + let ctx2 = xkbcommon::xkb::Context::new(xkbcommon::xkb::CONTEXT_NO_FLAGS); + xkbcommon::xkb::Keymap::new_from_string( + &ctx2, + serialized, + xkbcommon::xkb::KEYMAP_FORMAT_TEXT_V1, + xkbcommon::xkb::KEYMAP_COMPILE_NO_FLAGS, + ) + .ok_or_else(|| format!("{name}: round-trip re-parse failed"))?; + + Ok(()) +} + +#[test] +fn kbvm_compile_xkb_tests() { + let cases = collect_xkb_compile_tests(); + assert!(!cases.is_empty(), "No XKB compile test cases found"); + + let mut failures = Vec::new(); + + for case in &cases { + if let Err(e) = run_xkb_compile_test(case) { + failures.push(e); + } + } + + if !failures.is_empty() { + let mut msg = format!( + "{} of {} kbvm compile tests failed:\n\n", + failures.len(), + cases.len() + ); + for f in &failures { + msg.push_str(f); + msg.push('\n'); + } + panic!("{msg}"); + } + + eprintln!( + "All {} kbvm compile tests passed (round-trip verified)", + cases.len() + ); +} diff --git a/tests/type.rs b/tests/type.rs new file mode 100644 index 00000000..129708c9 --- /dev/null +++ b/tests/type.rs @@ -0,0 +1,255 @@ +//! kbvm type-test runner: parse map.xkb, replay key events, compare WKB vs xkbcommon. +//! +//! Test data from https://github.com/mahkoh/kbvm (MIT licensed). +//! Only tests that xkbcommon can handle are included. +//! +//! For each test we: +//! 1. Parse the keymap with xkbcommon and replay events +//! 2. Parse the same keymap with WKB and replay events +//! 3. Compare char output and modifier state between the two + +use std::collections::HashMap; +use std::fmt::Write; +use std::path::{Path, PathBuf}; +use wkb::testing::WKBTestExt; +use xkbcommon::xkb; + +const TEST_DATA_DIR: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/test_files"); +const EVDEV_OFFSET: u32 = 8; + +fn parse_generated_keycodes() -> HashMap { + let path = Path::new(TEST_DATA_DIR).join("type-include/keycodes/generated"); + let content = std::fs::read_to_string(&path).expect("read generated keycodes"); + let mut map = HashMap::new(); + for line in content.lines() { + let line = line.trim(); + if let Some(rest) = line.strip_prefix('<') { + if let Some((name, rest)) = rest.split_once('>') { + let rest = rest.trim().strip_prefix('=').unwrap_or("").trim(); + let rest = rest.strip_suffix(';').unwrap_or(rest).trim(); + if let Ok(code) = rest.parse::() { + map.insert(name.to_string(), code); + } + } + } + } + map +} + +fn collect_type_test_cases() -> Vec { + let base = Path::new(TEST_DATA_DIR).join("type-tests"); + let mut cases = Vec::new(); + collect_dirs(&base, "map.xkb", &mut cases); + cases.sort(); + cases +} + +fn collect_dirs(dir: &Path, filename: &str, out: &mut Vec) { + if dir.join(filename).exists() { + out.push(dir.to_path_buf()); + } + if let Ok(entries) = std::fs::read_dir(dir) { + for entry in entries.flatten() { + let path = entry.path(); + if path.is_dir() { + collect_dirs(&path, filename, out); + } + } + } +} + +fn build_full_keymap(case_dir: &Path) -> String { + let map_content = std::fs::read_to_string(case_dir.join("map.xkb")).expect("read map.xkb"); + let keycodes_path = Path::new(TEST_DATA_DIR).join("type-include/keycodes/generated"); + let keycodes = std::fs::read_to_string(&keycodes_path).expect("read keycodes"); + let inner = keycodes + .trim() + .strip_prefix("default xkb_keycodes {") + .and_then(|s| s.strip_suffix("};")) + .unwrap_or(&keycodes); + map_content.replace(r#"include "generated""#, inner.trim()) +} + +fn keysym_char(ks: xkb::Keysym) -> Option { + let ch = xkb::keysym_to_utf32(ks); + if ch == 0 { + None + } else { + char::from_u32(ch) + } +} + +fn case_name(case_dir: &Path) -> String { + case_dir + .strip_prefix(Path::new(TEST_DATA_DIR).join("type-tests")) + .unwrap_or(case_dir) + .display() + .to_string() +} + +/// Replay key events through xkbcommon and WKB, comparing output at each step. +fn run_type_test(case_dir: &Path, key_names: &HashMap) -> Result<(), String> { + let keymap_str = build_full_keymap(case_dir); + let name = case_name(case_dir); + + // Parse with xkbcommon + let ctx = xkb::Context::new(xkb::CONTEXT_NO_FLAGS); + let xkb_keymap = xkb::Keymap::new_from_string( + &ctx, + keymap_str, + xkb::KEYMAP_FORMAT_TEXT_V1, + xkb::KEYMAP_COMPILE_NO_FLAGS, + ) + .ok_or_else(|| format!("{name}: xkbcommon failed to parse"))?; + let mut xkb_state = xkb::State::new(&xkb_keymap); + + // Parse with WKB using xkbcommon's fully-expanded keymap string + // (the original minimal keymap may lack types/compat sections that WKB needs) + let full_keymap_str = xkb_keymap.get_as_string(xkb::KEYMAP_FORMAT_TEXT_V1); + let mut wkb = wkb::WKB::new_from_string(full_keymap_str); + + let input = std::fs::read_to_string(case_dir.join("input.txt")) + .map_err(|e| format!("{name}: read input.txt: {e}"))?; + + let mut diffs = Vec::new(); + + for line in input.lines() { + let stripped = line + .split_once('#') + .map(|(pre, _)| pre) + .unwrap_or(line) + .trim(); + if stripped.is_empty() { + continue; + } + + let (command, arg) = match stripped.split_once(' ') { + Some((c, a)) => (c.trim(), a.trim()), + None => (stripped, ""), + }; + + let get_kc = |key_name: &str| -> Result { + key_names + .get(key_name) + .copied() + .ok_or_else(|| format!("{name}: unknown key: {key_name}")) + }; + + match command { + "down" | "up" | "both" => { + let xkb_kc_raw = get_kc(arg)?; + let xkb_kc = xkb::Keycode::new(xkb_kc_raw); + + if xkb_kc_raw < EVDEV_OFFSET { + continue; + } + let evdev_code = xkb_kc_raw - EVDEV_OFFSET; + + let do_down = command == "down" || command == "both"; + let do_up = command == "up" || command == "both"; + + if do_down { + // Get char from xkbcommon (before update_key) + let xkb_syms = xkb_state.key_get_syms(xkb_kc); + let xkb_char = xkb_syms.first().and_then(|&s| keysym_char(s)); + + // Get char from WKB + let wkb_char = wkb.utf8(evdev_code); + + if xkb_char != wkb_char { + diffs.push(format!( + " {command} {arg}: char mismatch: \ + xkbcommon={xkb_char:?} wkb={wkb_char:?}" + )); + } + + // Update both states + xkb_state.update_key(xkb_kc, xkb::KeyDirection::Down); + wkb.update_key(evdev_code, wkb::KeyDirection::Down); + + // Compare modifier state + let xkb_mods = ( + xkb_state.serialize_mods(xkb::STATE_MODS_DEPRESSED), + xkb_state.serialize_mods(xkb::STATE_MODS_LATCHED), + xkb_state.serialize_mods(xkb::STATE_MODS_LOCKED), + ); + let (wkb_dep, wkb_lat, wkb_lock, _) = wkb.modifiers_state(); + + if xkb_mods != (wkb_dep, wkb_lat, wkb_lock) { + diffs.push(format!( + " {command} {arg} (after down): mods mismatch: \ + xkbcommon=({:#010x},{:#010x},{:#010x}) \ + wkb=({:#010x},{:#010x},{:#010x})", + xkb_mods.0, xkb_mods.1, xkb_mods.2, wkb_dep, wkb_lat, wkb_lock + )); + } + } + + if do_up { + xkb_state.update_key(xkb_kc, xkb::KeyDirection::Up); + wkb.update_key(evdev_code, wkb::KeyDirection::Up); + + let xkb_mods = ( + xkb_state.serialize_mods(xkb::STATE_MODS_DEPRESSED), + xkb_state.serialize_mods(xkb::STATE_MODS_LATCHED), + xkb_state.serialize_mods(xkb::STATE_MODS_LOCKED), + ); + let (wkb_dep, wkb_lat, wkb_lock, _) = wkb.modifiers_state(); + + if xkb_mods != (wkb_dep, wkb_lat, wkb_lock) { + diffs.push(format!( + " {command} {arg} (after up): mods mismatch: \ + xkbcommon=({:#010x},{:#010x},{:#010x}) \ + wkb=({:#010x},{:#010x},{:#010x})", + xkb_mods.0, xkb_mods.1, xkb_mods.2, wkb_dep, wkb_lat, wkb_lock + )); + } + } + } + "repeat" => {} + _ => return Err(format!("{name}: unknown command: {command}")), + } + } + + if diffs.is_empty() { + Ok(()) + } else { + let mut msg = format!("{name}: WKB vs xkbcommon differences:\n"); + for d in &diffs { + writeln!(msg, "{d}").unwrap(); + } + Err(msg) + } +} + +#[test] +fn kbvm_type_tests() { + let key_names = parse_generated_keycodes(); + let cases = collect_type_test_cases(); + assert!(!cases.is_empty(), "No type test cases found"); + + let mut failures = Vec::new(); + + for case in &cases { + if let Err(e) = run_type_test(case, &key_names) { + failures.push(e); + } + } + + if !failures.is_empty() { + let mut msg = format!( + "{} of {} kbvm type tests failed (WKB vs xkbcommon mismatch):\n\n", + failures.len(), + cases.len() + ); + for f in &failures { + writeln!(msg, "{f}").unwrap(); + } + panic!("{msg}"); + } + + eprintln!( + "All {} kbvm type tests passed (WKB matches xkbcommon)", + cases.len() + ); +} diff --git a/tests/unicode.rs b/tests/unicode.rs new file mode 100644 index 00000000..826c0842 --- /dev/null +++ b/tests/unicode.rs @@ -0,0 +1,85 @@ +//! Test for Unicode keysym support, particularly for keysyms > U+FFFF and +//! multi-byte Unicode characters in XKB symbol definitions. + +/// Minimal keymap with raw Unicode character ㄙ (U+3119) in key definition. +fn keymap_with_raw_unicode() -> String { + // Uses raw ㄙ character — WKB's preprocessor should convert it to U3119 + "xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + = 24; + }; + xkb_types { + virtual_modifiers LevelThree; + type \"FOUR_LEVEL\" { + modifiers = Shift+LevelThree; + map[Shift] = Level2; + map[LevelThree] = Level3; + map[Shift+LevelThree] = Level4; + level_name[Level1] = \"Base\"; + level_name[Level2] = \"Shift\"; + level_name[Level3] = \"Alt Base\"; + level_name[Level4] = \"Shift Alt\"; + }; + }; + xkb_compat { + }; + xkb_symbols { + key { [ ㄙ, Q, paragraph, degree ] }; + }; +};" + .to_string() +} + +/// Minimal keymap with U3119 keysym (standard XKB notation). +fn keymap_with_u3119() -> String { + "xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + = 24; + }; + xkb_types { + virtual_modifiers LevelThree; + type \"FOUR_LEVEL\" { + modifiers = Shift+LevelThree; + map[Shift] = Level2; + map[LevelThree] = Level3; + map[Shift+LevelThree] = Level4; + level_name[Level1] = \"Base\"; + level_name[Level2] = \"Shift\"; + level_name[Level3] = \"Alt Base\"; + level_name[Level4] = \"Shift Alt\"; + }; + }; + xkb_compat { + }; + xkb_symbols { + key { [ U3119, Q, paragraph, degree ] }; + }; +};" + .to_string() +} + +/// WKB handles U3119 keysym notation. +#[test] +fn wkb_handles_u3119() { + let mut wkb = wkb::WKB::new_from_string(keymap_with_u3119()); + let evdev_code = 16; // AD01: keycode 24 - 8 + let (ch, _) = wkb.key(evdev_code, wkb::KeyDirection::Down); + assert_eq!(ch, Some('ㄙ'), "WKB should produce ㄙ (U+3119) for AD01"); +} + +/// WKB preprocesses raw Unicode characters to UXXXX notation. +#[test] +fn wkb_handles_raw_unicode() { + let mut wkb = wkb::WKB::new_from_string(keymap_with_raw_unicode()); + let evdev_code = 16; // AD01: keycode 24 - 8 + let (ch, _) = wkb.key(evdev_code, wkb::KeyDirection::Down); + assert_eq!( + ch, + Some('ㄙ'), + "WKB should preprocess raw ㄙ and produce U+3119" + ); +} diff --git a/xkb-core/README.md b/xkb-core/README.md index 1a2f3d4f..79218e0a 100644 --- a/xkb-core/README.md +++ b/xkb-core/README.md @@ -1,8 +1,12 @@ # xkb-core +[![Crates.io](https://img.shields.io/crates/v/xkb-core.svg)](https://crates.io/crates/xkb-core) +[![Documentation](https://docs.rs/xkb-core/badge.svg)](https://docs.rs/xkb-core) +[![License](https://img.shields.io/crates/l/xkb-core.svg)](https://github.com/rano-oss/wkb/blob/main/LICENSE) + Pure Rust implementation of XKB keymap compilation, keyboard state management, compose table support, and keysym utilities. This crate is the engine behind -[`wkb`](https://crates.io/crates/wkb) and is not typically used directly. +[`wayland-keyboard`](https://crates.io/crates/wayland-keyboard) and is not typically used directly. ## What it provides diff --git a/xkb-core/src/rust_types.rs b/xkb-core/src/rust_types.rs index 412aefb1..3afe1073 100644 --- a/xkb-core/src/rust_types.rs +++ b/xkb-core/src/rust_types.rs @@ -65,6 +65,104 @@ impl RuleNames { } } +// ============================================================================ +// Unicode Preprocessing +// ============================================================================ + +/// Convert non-ASCII characters in XKB keymap strings to UXXXX keysym notation. +/// +/// The XKB scanner only accepts ASCII identifiers. When a keymap contains raw +/// Unicode characters as keysym names (e.g., `ㄙ` instead of `U3119`), this +/// function converts them so the parser can handle them. +/// +/// Characters inside strings (`"..."`), comments (`//` or `/* */`), and key +/// names (`<...>`) are left untouched. +fn preprocess_unicode_keysyms(input: &str) -> std::borrow::Cow<'_, str> { + use std::borrow::Cow; + use std::fmt::Write; + // Fast path: if there are no non-ASCII bytes, return as-is. + if input.is_ascii() { + return Cow::Borrowed(input); + } + + let mut result = String::with_capacity(input.len() + 64); + let mut chars = input.chars().peekable(); + let mut in_string = false; + let mut in_line_comment = false; + let mut in_block_comment = false; + let mut in_keyname = false; + let mut prev_char = '\0'; + + while let Some(ch) = chars.next() { + if in_line_comment { + result.push(ch); + if ch == '\n' { + in_line_comment = false; + } + prev_char = ch; + continue; + } + + if in_block_comment { + result.push(ch); + if prev_char == '*' && ch == '/' { + in_block_comment = false; + } + prev_char = ch; + continue; + } + + if in_string { + result.push(ch); + if ch == '"' && prev_char != '\\' { + in_string = false; + } + prev_char = ch; + continue; + } + + if in_keyname { + result.push(ch); + if ch == '>' { + in_keyname = false; + } + prev_char = ch; + continue; + } + + match ch { + '"' => { + in_string = true; + result.push(ch); + } + '/' if chars.peek() == Some(&'/') => { + in_line_comment = true; + result.push(ch); + } + '/' if chars.peek() == Some(&'*') => { + in_block_comment = true; + result.push(ch); + } + '<' => { + in_keyname = true; + result.push(ch); + } + c if !c.is_ascii() => { + let cp = c as u32; + if cp <= 0xFFFF { + write!(result, "U{:04X}", cp).unwrap(); + } else { + write!(result, "U{:05X}", cp).unwrap(); + } + } + _ => result.push(ch), + } + prev_char = ch; + } + + Cow::Owned(result) +} + // ============================================================================ // Safe RAII Wrappers for XKB FFI Types // ============================================================================ @@ -99,7 +197,8 @@ impl Context { pub fn keymap_from_string(&self, keymap_str: &str) -> Option { use crate::shared_types::{XKB_KEYMAP_COMPILE_NO_FLAGS, XKB_KEYMAP_FORMAT_TEXT_V1}; - let keymap_cstr = CString::new(keymap_str).ok()?; + let processed = preprocess_unicode_keysyms(keymap_str); + let keymap_cstr = CString::new(processed.as_ref()).ok()?; let keymap = super::keymap::xkb_keymap_new_from_string( self.entity.clone(), &keymap_cstr, From 2bb3bceff4296ebc80b41c089b2a5193f0d14f6e Mon Sep 17 00:00:00 2001 From: Eivind Gamst Date: Fri, 24 Apr 2026 16:42:42 +0200 Subject: [PATCH 2/5] Slight performance improvement --- examples/profile_setup.rs | 88 ++++++++++++++++++++++++ src/lib.rs | 37 +++++++--- src/xkb.rs | 21 +++--- xkb-core/src/context.rs | 44 +----------- xkb-core/src/keymap.rs | 83 +---------------------- xkb-core/src/keysym.rs | 5 +- xkb-core/src/lib.rs | 1 - xkb-core/src/state.rs | 83 ++--------------------- xkb-core/src/text.rs | 15 ++-- xkb-core/src/xkbcomp/ast_build.rs | 60 ++-------------- xkb-core/src/xkbcomp/include.rs | 60 ++-------------- xkb-core/src/xkbcomp/keymap.rs | 6 +- xkb-core/src/xkbcomp/keywords.rs | 10 +-- xkb-core/src/xkbcomp/parser.rs | 8 +-- xkb-core/src/xkbcomp/prelude.rs | 109 ++++++++++-------------------- xkb-core/src/xkbcomp/rules.rs | 58 ++-------------- xkb-core/src/xkbcomp/scanner.rs | 75 +++----------------- xkb-core/src/xkbcomp/types.rs | 2 +- xkb-core/src/xkbcomp/vmod.rs | 13 +--- xkb-core/src/xkbcomp/xkbcomp.rs | 84 +---------------------- 20 files changed, 215 insertions(+), 647 deletions(-) create mode 100644 examples/profile_setup.rs diff --git a/examples/profile_setup.rs b/examples/profile_setup.rs new file mode 100644 index 00000000..8af03ab0 --- /dev/null +++ b/examples/profile_setup.rs @@ -0,0 +1,88 @@ +use std::time::Instant; + +fn main() { + use xkb_core::rust_types::{Context, RuleNames}; + + let t0 = Instant::now(); + + let t_ctx = Instant::now(); + let ctx = Context::new().expect("ctx"); + eprintln!("1. context_new: {:?}", t_ctx.elapsed()); + + let t_km = Instant::now(); + let rules = RuleNames::evdev("us".to_string(), None); + let keymap = ctx.keymap_from_names(&rules).expect("keymap"); + eprintln!("2. keymap_from_names: {:?}", t_km.elapsed()); + + let t_st = Instant::now(); + let _state = keymap.new_state().expect("state"); + eprintln!("3. single new_state: {:?}", t_st.elapsed()); + + let t_st24 = Instant::now(); + for _ in 0..24 { + let _s = keymap.new_state(); + } + eprintln!("4. 24x new_state: {:?}", t_st24.elapsed()); + + let min_kc = keymap.min_keycode().max(8); + let max_kc = keymap.max_keycode(); + let num_keys = (max_kc - min_kc + 1) as usize; + + let t_iter = Instant::now(); + for _ in 0..8 { + if let Some(st) = keymap.new_state() { + for kc in min_kc..=max_kc { + let _ = st.key_get_utf8(kc); + } + } + } + eprintln!( + "5. 8x(new_state+{}x get_utf8): {:?}", + num_keys, + t_iter.elapsed() + ); + + // Simulate populate_lock (caps): 8 levels x (new_state + toggle + iterate) + let t_lock = Instant::now(); + for _ in 0..8 { + if let Some(mut st) = keymap.new_state() { + st.update_key(66, xkb_core::XKB_KEY_DOWN); // caps lock X11 keycode + st.update_key(66, xkb_core::XKB_KEY_UP); + for kc in min_kc..=max_kc { + let _ = st.key_get_utf8(kc); + } + } + } + eprintln!("6. populate_lock(caps): {:?}", t_lock.elapsed()); + + // level_exceptions: 8 levels x keycodes x key_get_syms_by_level + let t_exc = Instant::now(); + for lvl in 0..8u32 { + for kc in min_kc..=max_kc { + let _ = keymap.key_get_syms_by_level(kc, 0, lvl); + } + } + eprintln!("7. level_exceptions: {:?}", t_exc.elapsed()); + + let t_compose = Instant::now(); + let resolved = xkb_core::compose::resolve_compose_file("en_US.UTF-8"); + if let Some(subpath) = resolved { + let path = std::path::Path::new("/usr/share/X11/locale").join(&subpath); + let _ = xkb_core::compose::parse_compose_file(&path); + } + eprintln!("8. compose_table: {:?}", t_compose.elapsed()); + + // Full WKB setup for comparison + let t_wkb = Instant::now(); + let _wkb: wkb::WKB = + wkb::WKB::new_from_names("us".to_string(), None); + eprintln!("\nFull WKB new_from_names: {:?}", t_wkb.elapsed()); + + // With explicit layout (skip get_all_layouts) + let t_wkb2 = Instant::now(); + let _wkb2: wkb::WKB = + wkb::WKB::new_from_names("us".to_string(), Some(String::new())); + eprintln!("WKB with explicit layout: {:?}", t_wkb2.elapsed()); + + eprintln!("Total profiling time: {:?}", t0.elapsed()); +} diff --git a/src/lib.rs b/src/lib.rs index a9a37f63..cacff98a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -23,6 +23,9 @@ //! - **`compose`** (default) — Compose-key / dead-key sequence support. //! - **`testing`** — Exposes internal helpers for integration tests. Not part of the public API. +#[cfg(feature = "xkb")] +use std::cell::OnceCell; + use composer::{ComposeState, Composer, ListComposer, Token}; mod composer; pub use modifiers::KeyDirection; @@ -141,9 +144,6 @@ const MODIFIER_MAPPING: [(u32, u32); 9] = [ /// `C` is the compose backend — typically [`ListComposer`] when using the `xkb` feature. #[derive(Debug, Clone)] pub struct WKB { - pub(crate) layouts: Vec, - pub(crate) layout: String, - // pub(crate) locale: Option, pub(crate) pressed_keys: KeyBitSet, pub(crate) repeat_keys: KeyBitSet, pub(crate) composer: C, @@ -151,8 +151,15 @@ pub struct WKB { pub(crate) state_keymap: FlatKeymap, pub(crate) num_lock_keys: FlatKeymap, pub(crate) caps_lock_keymap: FlatKeymap, + #[cfg(feature = "xkb")] pub(crate) level_exceptions_keymap: FlatKeymap, #[cfg(feature = "xkb")] + pub(crate) layouts: OnceCell>, + #[cfg(feature = "xkb")] + pub(crate) locale: Option, + #[cfg(feature = "xkb")] + pub(crate) layout: String, + #[cfg(feature = "xkb")] pub(crate) xkb_keymap: Option, } @@ -235,10 +242,7 @@ impl WKB { } /// Apply modifier state received from `wl_keyboard.modifiers`. Updates depressed, latched, locked masks and active layout group. - pub fn update_modifiers(&mut self, depressed: u32, latched: u32, locked: u32, group: u32) { - if let Some(l) = self.layouts.get(group as usize) { - self.layout = l.clone(); - } + pub fn update_modifiers(&mut self, depressed: u32, latched: u32, locked: u32, _group: u32) { for (code, bit) in MODIFIER_MAPPING { let is_depressed = (depressed & bit) != 0; let is_locked = (locked & bit) != 0; @@ -268,6 +272,7 @@ impl WKB { } /// Look up the character at a specific shift level for the given evdev keycode. + #[cfg(feature = "xkb")] #[inline] pub fn level_key(&self, evdev_code: u32, level_index: usize) -> Option { self.level_exceptions_keymap @@ -275,6 +280,13 @@ impl WKB { .or_else(|| self.state_keymap.get(level_index, evdev_code)) } + /// Look up the character at a specific shift level for the given evdev keycode. + #[cfg(not(feature = "xkb"))] + #[inline] + pub fn level_key(&self, evdev_code: u32, level_index: usize) -> Option { + self.state_keymap.get(level_index, evdev_code) + } + /// Return the number of shift levels supported by this keymap. #[inline] pub fn num_levels(&self) -> usize { @@ -367,11 +379,20 @@ impl WKB { } /// Return the list of layout names available in this keymap. + #[cfg(feature = "xkb")] pub fn layouts(&self) -> Vec { - self.layouts.clone() + self.layouts + .get_or_init(|| { + self.locale + .as_deref() + .map(xkb::get_all_layouts_for_locale) + .unwrap_or_else(|| vec![self.layout.clone()]) + }) + .clone() } /// Return the name of the currently active layout. + #[cfg(feature = "xkb")] pub fn current_layout(&self) -> String { self.layout.clone() } diff --git a/src/xkb.rs b/src/xkb.rs index 91a56d58..56c4163b 100644 --- a/src/xkb.rs +++ b/src/xkb.rs @@ -10,7 +10,7 @@ use crate::ListComposer; use crate::{KeyBitSet, WKB}; /// Get all available layouts/variants for a given locale -fn get_all_layouts_for_locale(locale: &str) -> Vec { +pub(crate) fn get_all_layouts_for_locale(locale: &str) -> Vec { use xkb_core::rust_types::RxkbContext; let mut ctx = match RxkbContext::new() { @@ -147,7 +147,6 @@ fn build_wkb_from_keymap( keymap: &xkb_core::rust_types::Keymap, locale: Option, layout: Option, - all_layouts: Vec, store_keymap: bool, ) -> WKB { const XKB_MAX_LEVELS: usize = 8; @@ -280,11 +279,11 @@ fn build_wkb_from_keymap( let composer = ListComposer::new(); WKB { - layouts: all_layouts, + layouts: std::cell::OnceCell::new(), + locale: locale.clone(), layout: layout .clone() .unwrap_or_else(|| locale.clone().unwrap_or_default()), - // locale, pressed_keys: KeyBitSet::new(), repeat_keys, composer, @@ -305,12 +304,6 @@ fn build_wkb_from_keymap( pub fn new_from_names(locale: String, layout: Option) -> WKB { use xkb_core::rust_types::{Context, RuleNames}; - let all_layouts = if layout.is_none() { - get_all_layouts_for_locale(&locale) - } else { - vec![layout.clone().unwrap()] - }; - let ctx = Context::new().expect("Failed to create XKB context"); let rules = RuleNames::evdev(locale.clone(), layout.clone()); @@ -318,7 +311,7 @@ pub fn new_from_names(locale: String, layout: Option) -> WKB WKB { .keymap_from_string(&string) .expect("Failed to parse keymap from string"); - build_wkb_from_keymap(&keymap, None, None, vec![String::new()], true) + build_wkb_from_keymap(&keymap, None, None, true) } /// Backward-compatible alias for compose module access pub mod compose_parse { pub use super::load_compose_from_path; - pub use xkb_core::compose::*; + pub use xkb_core::compose::{ + keysym_name_to_char, parse_compose_file, resolve_compose_file, ComposeEntry, + }; } #[cfg(test)] diff --git a/xkb-core/src/context.rs b/xkb-core/src/context.rs index 947aa24b..fd33756f 100644 --- a/xkb-core/src/context.rs +++ b/xkb-core/src/context.rs @@ -3,57 +3,15 @@ use std::env::VarError; use crate::atom::{atom_intern, atom_table_new, atom_text}; pub use crate::messages::{ - XKB_ERROR_ABI_BACKWARD_COMPAT_, XKB_ERROR_ABI_FORWARD_COMPAT_, - XKB_ERROR_ABI_INVALID_STRUCT_SIZE_, XKB_ERROR_ALLOCATION_ERROR, XKB_ERROR_CANNOT_RESOLVE_RMLVO, - XKB_ERROR_CONFLICTING_KEY_SYMBOLS_ENTRY, XKB_ERROR_EXPECTED_ARRAY_ENTRY, - XKB_ERROR_GLOBAL_DEFAULTS_WRONG_SCOPE, XKB_ERROR_INCLUDED_FILE_NOT_FOUND, - XKB_ERROR_INCOMPATIBLE_ACTIONS_AND_KEYSYMS_COUNT, XKB_ERROR_INCOMPATIBLE_KEYMAP_TEXT_FORMAT, - XKB_ERROR_INSUFFICIENT_BUFFER_SIZE, XKB_ERROR_INTEGER_OVERFLOW, XKB_ERROR_INVALID_ACTION_FIELD, - XKB_ERROR_INVALID_COMPOSE_LOCALE, XKB_ERROR_INVALID_COMPOSE_SYNTAX, - XKB_ERROR_INVALID_EXPRESSION_TYPE, XKB_ERROR_INVALID_FILE_ENCODING, - XKB_ERROR_INVALID_IDENTIFIER, XKB_ERROR_INVALID_INCLUDED_FILE, - XKB_ERROR_INVALID_INCLUDE_STATEMENT, XKB_ERROR_INVALID_MODMAP_ENTRY, - XKB_ERROR_INVALID_NUMERIC_KEYSYM, XKB_ERROR_INVALID_OPERATION, XKB_ERROR_INVALID_PATH, - XKB_ERROR_INVALID_REAL_MODIFIER, XKB_ERROR_INVALID_RULES_SYNTAX, - XKB_ERROR_INVALID_SET_DEFAULT_STATEMENT, XKB_ERROR_INVALID_VALUE, XKB_ERROR_INVALID_XKB_SYNTAX, - XKB_ERROR_KEYMAP_COMPILATION_FAILED, XKB_ERROR_MALFORMED_NUMBER_LITERAL, - XKB_ERROR_NO_VALID_DEFAULT_INCLUDE_PATH, XKB_ERROR_OVERLAPPING_OVERLAY, - XKB_ERROR_RECURSIVE_INCLUDE, XKB_ERROR_RULES_INVALID_LAYOUT_INDEX_PERCENT_EXPANSION, - XKB_ERROR_UNDECLARED_VIRTUAL_MODIFIER, XKB_ERROR_UNKNOWN_ACTION_TYPE, - XKB_ERROR_UNKNOWN_DEFAULT_FIELD, XKB_ERROR_UNKNOWN_FIELD, XKB_ERROR_UNKNOWN_OPERATOR, - XKB_ERROR_UNKNOWN_STATEMENT, XKB_ERROR_UNSUPPORTED_A11Y_FLAGS_, - XKB_ERROR_UNSUPPORTED_LAYOUT_INDEX_, XKB_ERROR_UNSUPPORTED_LAYOUT_OUT_OF_RANGE_POLICY_, - XKB_ERROR_UNSUPPORTED_MODIFIER_MASK_, XKB_ERROR_UNSUPPORTED_OVERLAY_INDEX, - XKB_ERROR_UNSUPPORTED_SHIFT_LEVEL, XKB_ERROR_WRONG_FIELD_TYPE, XKB_ERROR_WRONG_STATEMENT_TYPE, - XKB_LOG_VERBOSITY_BRIEF, XKB_LOG_VERBOSITY_COMPREHENSIVE, XKB_LOG_VERBOSITY_DEFAULT, - XKB_LOG_VERBOSITY_DETAILED, XKB_LOG_VERBOSITY_MINIMAL, XKB_LOG_VERBOSITY_SILENT, - XKB_LOG_VERBOSITY_VERBOSE, XKB_WARNING_CANNOT_INFER_KEY_TYPE, - XKB_WARNING_CONFLICTING_KEY_ACTION, XKB_WARNING_CONFLICTING_KEY_FIELDS, - XKB_WARNING_CONFLICTING_KEY_NAME, XKB_WARNING_CONFLICTING_KEY_SYMBOL, - XKB_WARNING_CONFLICTING_KEY_TYPE_DEFINITIONS, XKB_WARNING_CONFLICTING_KEY_TYPE_LEVEL_NAMES, - XKB_WARNING_CONFLICTING_KEY_TYPE_MAP_ENTRY, XKB_WARNING_CONFLICTING_KEY_TYPE_MERGING_GROUPS, - XKB_WARNING_CONFLICTING_KEY_TYPE_PRESERVE_ENTRIES, XKB_WARNING_CONFLICTING_MODMAP, - XKB_WARNING_DEPRECATED_KEYSYM, XKB_WARNING_DEPRECATED_KEYSYM_NAME, XKB_WARNING_DUPLICATE_ENTRY, - XKB_WARNING_EXTRA_SYMBOLS_IGNORED, XKB_WARNING_ILLEGAL_KEYCODE_ALIAS, - XKB_WARNING_ILLEGAL_KEY_TYPE_PRESERVE_RESULT, XKB_WARNING_INVALID_ESCAPE_SEQUENCE, - XKB_WARNING_INVALID_UNICODE_ESCAPE_SEQUENCE, XKB_WARNING_MISSING_DEFAULT_SECTION, - XKB_WARNING_MISSING_SYMBOLS_GROUP_NAME_INDEX, XKB_WARNING_MULTIPLE_GROUPS_AT_ONCE, - XKB_WARNING_NON_BASE_GROUP_NAME, XKB_WARNING_NUMERIC_KEYSYM, - XKB_WARNING_UNDECLARED_MODIFIERS_IN_KEY_TYPE, XKB_WARNING_UNDEFINED_KEYCODE, - XKB_WARNING_UNDEFINED_KEY_TYPE, XKB_WARNING_UNKNOWN_CHAR_ESCAPE_SEQUENCE, - XKB_WARNING_UNRECOGNIZED_KEYSYM, XKB_WARNING_UNRESOLVED_KEYMAP_SYMBOL, - XKB_WARNING_UNSUPPORTED_GEOMETRY_SECTION, XKB_WARNING_UNSUPPORTED_LEGACY_ACTION, - XKB_WARNING_UNSUPPORTED_SYMBOLS_FIELD, _XKB_LOG_MESSAGE_MAX_CODE, _XKB_LOG_MESSAGE_MIN_CODE, + XKB_ERROR_NO_VALID_DEFAULT_INCLUDE_PATH, XKB_LOG_VERBOSITY_DEFAULT, }; use crate::shared_types::{ DFLT_XKB_CONFIG_EXTRA_PATH, DFLT_XKB_CONFIG_ROOT, DFLT_XKB_CONFIG_UNVERSIONED_EXTENSIONS_PATH, DFLT_XKB_CONFIG_VERSIONED_EXTENSIONS_PATH, DFLT_XKB_LEGACY_ROOT, }; -pub use crate::shared_types::{EACCES, ENOMEM, ENOTDIR}; pub use crate::shared_types::{ RMLVO, RMLVO_LAYOUT, RMLVO_MODEL, RMLVO_OPTIONS, RMLVO_RULES, RMLVO_VARIANT, }; -pub use crate::shared_types::{R_OK, X_OK}; fn context_include_path_append(ctx: &mut xkb_context, path: &str) -> i32 { let is_dir = std::fs::metadata(path).map(|m| m.is_dir()).unwrap_or(false); if is_dir { diff --git a/xkb-core/src/keymap.rs b/xkb-core/src/keymap.rs index c7af1bb9..6bdf81ac 100644 --- a/xkb-core/src/keymap.rs +++ b/xkb-core/src/keymap.rs @@ -2,88 +2,11 @@ use std::rc::Rc; use crate::atom::{atom_lookup_ref, atom_text}; use crate::context::{xkb_atom_intern_bytes, xkb_context_sanitize_rule_names}; -pub use crate::messages::{ - XKB_ERROR_ABI_BACKWARD_COMPAT_, XKB_ERROR_ABI_FORWARD_COMPAT_, - XKB_ERROR_ABI_INVALID_STRUCT_SIZE_, XKB_ERROR_ALLOCATION_ERROR, XKB_ERROR_CANNOT_RESOLVE_RMLVO, - XKB_ERROR_CONFLICTING_KEY_SYMBOLS_ENTRY, XKB_ERROR_EXPECTED_ARRAY_ENTRY, - XKB_ERROR_GLOBAL_DEFAULTS_WRONG_SCOPE, XKB_ERROR_INCLUDED_FILE_NOT_FOUND, - XKB_ERROR_INCOMPATIBLE_ACTIONS_AND_KEYSYMS_COUNT, XKB_ERROR_INCOMPATIBLE_KEYMAP_TEXT_FORMAT, - XKB_ERROR_INSUFFICIENT_BUFFER_SIZE, XKB_ERROR_INTEGER_OVERFLOW, XKB_ERROR_INVALID_ACTION_FIELD, - XKB_ERROR_INVALID_COMPOSE_LOCALE, XKB_ERROR_INVALID_COMPOSE_SYNTAX, - XKB_ERROR_INVALID_EXPRESSION_TYPE, XKB_ERROR_INVALID_FILE_ENCODING, - XKB_ERROR_INVALID_IDENTIFIER, XKB_ERROR_INVALID_INCLUDED_FILE, - XKB_ERROR_INVALID_INCLUDE_STATEMENT, XKB_ERROR_INVALID_MODMAP_ENTRY, - XKB_ERROR_INVALID_NUMERIC_KEYSYM, XKB_ERROR_INVALID_OPERATION, XKB_ERROR_INVALID_PATH, - XKB_ERROR_INVALID_REAL_MODIFIER, XKB_ERROR_INVALID_RULES_SYNTAX, - XKB_ERROR_INVALID_SET_DEFAULT_STATEMENT, XKB_ERROR_INVALID_VALUE, XKB_ERROR_INVALID_XKB_SYNTAX, - XKB_ERROR_KEYMAP_COMPILATION_FAILED, XKB_ERROR_MALFORMED_NUMBER_LITERAL, - XKB_ERROR_NO_VALID_DEFAULT_INCLUDE_PATH, XKB_ERROR_OVERLAPPING_OVERLAY, - XKB_ERROR_RECURSIVE_INCLUDE, XKB_ERROR_RULES_INVALID_LAYOUT_INDEX_PERCENT_EXPANSION, - XKB_ERROR_UNDECLARED_VIRTUAL_MODIFIER, XKB_ERROR_UNKNOWN_ACTION_TYPE, - XKB_ERROR_UNKNOWN_DEFAULT_FIELD, XKB_ERROR_UNKNOWN_FIELD, XKB_ERROR_UNKNOWN_OPERATOR, - XKB_ERROR_UNKNOWN_STATEMENT, XKB_ERROR_UNSUPPORTED_A11Y_FLAGS_, - XKB_ERROR_UNSUPPORTED_LAYOUT_INDEX_, XKB_ERROR_UNSUPPORTED_LAYOUT_OUT_OF_RANGE_POLICY_, - XKB_ERROR_UNSUPPORTED_MODIFIER_MASK_, XKB_ERROR_UNSUPPORTED_OVERLAY_INDEX, - XKB_ERROR_UNSUPPORTED_SHIFT_LEVEL, XKB_ERROR_WRONG_FIELD_TYPE, XKB_ERROR_WRONG_STATEMENT_TYPE, - XKB_LOG_VERBOSITY_BRIEF, XKB_LOG_VERBOSITY_COMPREHENSIVE, XKB_LOG_VERBOSITY_DEFAULT, - XKB_LOG_VERBOSITY_DETAILED, XKB_LOG_VERBOSITY_MINIMAL, XKB_LOG_VERBOSITY_SILENT, - XKB_LOG_VERBOSITY_VERBOSE, XKB_WARNING_CANNOT_INFER_KEY_TYPE, - XKB_WARNING_CONFLICTING_KEY_ACTION, XKB_WARNING_CONFLICTING_KEY_FIELDS, - XKB_WARNING_CONFLICTING_KEY_NAME, XKB_WARNING_CONFLICTING_KEY_SYMBOL, - XKB_WARNING_CONFLICTING_KEY_TYPE_DEFINITIONS, XKB_WARNING_CONFLICTING_KEY_TYPE_LEVEL_NAMES, - XKB_WARNING_CONFLICTING_KEY_TYPE_MAP_ENTRY, XKB_WARNING_CONFLICTING_KEY_TYPE_MERGING_GROUPS, - XKB_WARNING_CONFLICTING_KEY_TYPE_PRESERVE_ENTRIES, XKB_WARNING_CONFLICTING_MODMAP, - XKB_WARNING_DEPRECATED_KEYSYM, XKB_WARNING_DEPRECATED_KEYSYM_NAME, XKB_WARNING_DUPLICATE_ENTRY, - XKB_WARNING_EXTRA_SYMBOLS_IGNORED, XKB_WARNING_ILLEGAL_KEYCODE_ALIAS, - XKB_WARNING_ILLEGAL_KEY_TYPE_PRESERVE_RESULT, XKB_WARNING_INVALID_ESCAPE_SEQUENCE, - XKB_WARNING_INVALID_UNICODE_ESCAPE_SEQUENCE, XKB_WARNING_MISSING_DEFAULT_SECTION, - XKB_WARNING_MISSING_SYMBOLS_GROUP_NAME_INDEX, XKB_WARNING_MULTIPLE_GROUPS_AT_ONCE, - XKB_WARNING_NON_BASE_GROUP_NAME, XKB_WARNING_NUMERIC_KEYSYM, - XKB_WARNING_UNDECLARED_MODIFIERS_IN_KEY_TYPE, XKB_WARNING_UNDEFINED_KEYCODE, - XKB_WARNING_UNDEFINED_KEY_TYPE, XKB_WARNING_UNKNOWN_CHAR_ESCAPE_SEQUENCE, - XKB_WARNING_UNRECOGNIZED_KEYSYM, XKB_WARNING_UNRESOLVED_KEYMAP_SYMBOL, - XKB_WARNING_UNSUPPORTED_GEOMETRY_SECTION, XKB_WARNING_UNSUPPORTED_LEGACY_ACTION, - XKB_WARNING_UNSUPPORTED_SYMBOLS_FIELD, _XKB_LOG_MESSAGE_MAX_CODE, _XKB_LOG_MESSAGE_MIN_CODE, -}; -pub use crate::shared_types::{ - entry_is_active, xkb_action, xkb_action_controls, xkb_action_flags, xkb_controls_action, - xkb_explicit_components, xkb_group, xkb_group_action, xkb_internal_action, xkb_key, - xkb_key_alias, xkb_key_type, xkb_key_type_entry, xkb_keymap, xkb_keysym_count_t, xkb_led, - xkb_level, xkb_mod, xkb_mod_action, xkb_mod_set, xkb_mods, xkb_overlay_mask_t, - xkb_pointer_action, xkb_pointer_button_action, xkb_pointer_default_action, xkb_private_action, - xkb_redirect_key_action, xkb_switch_screen_action, xkb_sym_interpret, KeycodeMatch, - ACTION_ABSOLUTE_SWITCH, ACTION_ABSOLUTE_X, ACTION_ABSOLUTE_Y, ACTION_ACCEL, - ACTION_LATCH_ON_PRESS, ACTION_LATCH_TO_LOCK, ACTION_LOCK_CLEAR, ACTION_LOCK_NO_LOCK, - ACTION_LOCK_NO_UNLOCK, ACTION_LOCK_ON_RELEASE, ACTION_MODS_LOOKUP_MODMAP, - ACTION_PENDING_COMPUTATION, ACTION_SAME_SCREEN, ACTION_TYPE_CTRL_LOCK, ACTION_TYPE_CTRL_SET, - ACTION_TYPE_GROUP_LATCH, ACTION_TYPE_GROUP_LOCK, ACTION_TYPE_GROUP_SET, ACTION_TYPE_INTERNAL, - ACTION_TYPE_MOD_LATCH, ACTION_TYPE_MOD_LOCK, ACTION_TYPE_MOD_SET, ACTION_TYPE_NONE, - ACTION_TYPE_PRIVATE, ACTION_TYPE_PTR_BUTTON, ACTION_TYPE_PTR_DEFAULT, ACTION_TYPE_PTR_LOCK, - ACTION_TYPE_PTR_MOVE, ACTION_TYPE_REDIRECT_KEY, ACTION_TYPE_SWITCH_VT, ACTION_TYPE_TERMINATE, - ACTION_TYPE_UNKNOWN, ACTION_TYPE_UNSUPPORTED_LEGACY, ACTION_TYPE_VOID, ACTION_UNLOCK_ON_PRESS, - CONTROL_ALL, CONTROL_ALL_BOOLEAN, CONTROL_ALL_BOOLEAN_V1, CONTROL_ALL_V1, CONTROL_AX, - CONTROL_AX_FEEDBACK, CONTROL_AX_TIMEOUT, CONTROL_BELL, CONTROL_DEBOUNCE, CONTROL_GROUPS_WRAP, - CONTROL_IGNORE_GROUP_LOCK, CONTROL_MOUSE_KEYS, CONTROL_MOUSE_KEYS_ACCEL, CONTROL_OVERLAY1, - CONTROL_OVERLAY2, CONTROL_OVERLAY3, CONTROL_OVERLAY4, CONTROL_OVERLAY5, CONTROL_OVERLAY6, - CONTROL_OVERLAY7, CONTROL_OVERLAY8, CONTROL_REPEAT, CONTROL_SLOW, CONTROL_STICKY_KEYS, - EXPLICIT_INTERP, EXPLICIT_OVERLAY, EXPLICIT_REPEAT, EXPLICIT_SYMBOLS, EXPLICIT_TYPES, - EXPLICIT_VMODMAP, INTERNAL_BREAKS_GROUP_LATCH, INTERNAL_BREAKS_MOD_LATCH, MATCH_ALL, MATCH_ANY, - MATCH_ANY_OR_NONE, MATCH_EXACTLY, MATCH_NONE, MOD_BOTH, MOD_REAL, MOD_VIRT, XKB_MAX_GROUPS, - _ACTION_TYPE_NUM_ENTRIES, -}; -pub use crate::shared_types::{ - RMLVO, RMLVO_LAYOUT, RMLVO_MODEL, RMLVO_OPTIONS, RMLVO_RULES, RMLVO_VARIANT, -}; pub use crate::shared_types::{ - XKB_A11Y_FLAGS_VALUES, XKB_COMPOSE_COMPILE_FLAGS_VALUES, XKB_COMPOSE_FEED_RESULT_VALUES, - XKB_COMPOSE_FORMAT_VALUES, XKB_COMPOSE_STATE_FLAGS_VALUES, XKB_COMPOSE_STATUS_VALUES, - XKB_CONSUMED_MODE_VALUES, XKB_CONTEXT_FLAGS_VALUES, XKB_EVENTS_FLAGS_VALUES, - XKB_EVENT_TYPE_VALUES, XKB_KEYBOARD_CONTROL_FLAGS_VALUES, XKB_KEYMAP_COMPILE_FLAGS_VALUES, - XKB_KEYMAP_FORMAT_VALUES, XKB_KEYMAP_KEY_ITERATOR_FLAGS_VALUES, - XKB_KEYMAP_SERIALIZE_FLAGS_VALUES, XKB_KEYSYM_FLAGS_VALUES, XKB_KEY_DIRECTION_VALUES, - XKB_LAYOUT_OUT_OF_RANGE_POLICY_VALUES, XKB_RMLVO_BUILDER_FLAGS_VALUES, - XKB_STATE_COMPONENT_VALUES, XKB_STATE_MATCH_VALUES, + xkb_action, xkb_key, xkb_keymap, xkb_led, + xkb_level, xkb_mod_set, MOD_BOTH, MOD_REAL, }; +pub use crate::shared_types::XKB_KEYMAP_COMPILE_FLAGS_VALUES; pub fn clear_level(leveli: &mut xkb_level) { leveli.syms.clear(); leveli.actions.clear(); diff --git a/xkb-core/src/keysym.rs b/xkb-core/src/keysym.rs index 40751435..2e414cc3 100644 --- a/xkb-core/src/keysym.rs +++ b/xkb-core/src/keysym.rs @@ -21774,7 +21774,6 @@ pub mod keysym_names_h { ]; pub static explicit_deprecated_aliases: [u32; 1] = [24103]; } -pub use crate::utf8_decoding::{utf8_next_code_point_safe, INVALID_UTF8_CODE_POINT}; pub const XKB_KEYSYM_MAX_EXPLICIT: i32 = 0x1008ffb8; pub const XKB_KEYSYM_UNICODE_OFFSET: i32 = 0x1000000; @@ -21782,8 +21781,8 @@ pub const XKB_KEYSYM_UNICODE_MIN: i32 = 0x1000100; pub const XKB_KEYSYM_UNICODE_MAX: i32 = 0x110ffff; pub use self::keysym_names_h::{ - deprecated_keysyms, explicit_deprecated_aliases, keysym_name_G, keysym_name_perfect_hash, - keysym_names, keysym_to_name, name_keysym, name_to_keysym, DEPRECATED_KEYSYM, UNICODE_KEYSYM, + keysym_name_perfect_hash, + keysym_names, keysym_to_name, name_keysym, name_to_keysym, }; use crate::utils::istrcmp; fn find_keysym_index(ks: u32) -> isize { diff --git a/xkb-core/src/lib.rs b/xkb-core/src/lib.rs index 6596ffb1..2a3e6690 100644 --- a/xkb-core/src/lib.rs +++ b/xkb-core/src/lib.rs @@ -1,7 +1,6 @@ #![allow(non_snake_case)] #![allow(non_camel_case_types)] #![allow(non_upper_case_globals)] -#![allow(unused_imports)] #![allow(dead_code)] //! # xkb-core diff --git a/xkb-core/src/state.rs b/xkb-core/src/state.rs index 3191c8b3..f06ebbe7 100644 --- a/xkb-core/src/state.rs +++ b/xkb-core/src/state.rs @@ -114,90 +114,19 @@ pub const XKB_FEATURE_ENUM_CONTEXT_FLAGS: xkb_feature = 3200; pub const XKB_FEATURE_ENUM_ERROR_CODE: xkb_feature = 1000; pub const XKB_FEATURE_ENUM_FEATURE: xkb_feature = 1; -pub use crate::features::xkb_feature_supported; -pub use crate::keymap::xkb_keymap_key_get_level; pub use crate::keymap::{ - xkb_keymap_key_get_actions_by_level, XkbLevelsSameSyms, XkbWrapGroupIntoRange, -}; -pub use crate::messages::{ - XKB_ERROR_ABI_BACKWARD_COMPAT_, XKB_ERROR_ABI_FORWARD_COMPAT_, - XKB_ERROR_ABI_INVALID_STRUCT_SIZE_, XKB_ERROR_ALLOCATION_ERROR, XKB_ERROR_CANNOT_RESOLVE_RMLVO, - XKB_ERROR_CONFLICTING_KEY_SYMBOLS_ENTRY, XKB_ERROR_EXPECTED_ARRAY_ENTRY, - XKB_ERROR_GLOBAL_DEFAULTS_WRONG_SCOPE, XKB_ERROR_INCLUDED_FILE_NOT_FOUND, - XKB_ERROR_INCOMPATIBLE_ACTIONS_AND_KEYSYMS_COUNT, XKB_ERROR_INCOMPATIBLE_KEYMAP_TEXT_FORMAT, - XKB_ERROR_INSUFFICIENT_BUFFER_SIZE, XKB_ERROR_INTEGER_OVERFLOW, XKB_ERROR_INVALID_ACTION_FIELD, - XKB_ERROR_INVALID_COMPOSE_LOCALE, XKB_ERROR_INVALID_COMPOSE_SYNTAX, - XKB_ERROR_INVALID_EXPRESSION_TYPE, XKB_ERROR_INVALID_FILE_ENCODING, - XKB_ERROR_INVALID_IDENTIFIER, XKB_ERROR_INVALID_INCLUDED_FILE, - XKB_ERROR_INVALID_INCLUDE_STATEMENT, XKB_ERROR_INVALID_MODMAP_ENTRY, - XKB_ERROR_INVALID_NUMERIC_KEYSYM, XKB_ERROR_INVALID_OPERATION, XKB_ERROR_INVALID_PATH, - XKB_ERROR_INVALID_REAL_MODIFIER, XKB_ERROR_INVALID_RULES_SYNTAX, - XKB_ERROR_INVALID_SET_DEFAULT_STATEMENT, XKB_ERROR_INVALID_VALUE, XKB_ERROR_INVALID_XKB_SYNTAX, - XKB_ERROR_KEYMAP_COMPILATION_FAILED, XKB_ERROR_MALFORMED_NUMBER_LITERAL, - XKB_ERROR_NO_VALID_DEFAULT_INCLUDE_PATH, XKB_ERROR_OVERLAPPING_OVERLAY, - XKB_ERROR_RECURSIVE_INCLUDE, XKB_ERROR_RULES_INVALID_LAYOUT_INDEX_PERCENT_EXPANSION, - XKB_ERROR_UNDECLARED_VIRTUAL_MODIFIER, XKB_ERROR_UNKNOWN_ACTION_TYPE, - XKB_ERROR_UNKNOWN_DEFAULT_FIELD, XKB_ERROR_UNKNOWN_FIELD, XKB_ERROR_UNKNOWN_OPERATOR, - XKB_ERROR_UNKNOWN_STATEMENT, XKB_ERROR_UNSUPPORTED_A11Y_FLAGS_, - XKB_ERROR_UNSUPPORTED_LAYOUT_INDEX_, XKB_ERROR_UNSUPPORTED_LAYOUT_OUT_OF_RANGE_POLICY_, - XKB_ERROR_UNSUPPORTED_MODIFIER_MASK_, XKB_ERROR_UNSUPPORTED_OVERLAY_INDEX, - XKB_ERROR_UNSUPPORTED_SHIFT_LEVEL, XKB_ERROR_WRONG_FIELD_TYPE, XKB_ERROR_WRONG_STATEMENT_TYPE, - XKB_LOG_VERBOSITY_BRIEF, XKB_LOG_VERBOSITY_COMPREHENSIVE, XKB_LOG_VERBOSITY_DEFAULT, - XKB_LOG_VERBOSITY_DETAILED, XKB_LOG_VERBOSITY_MINIMAL, XKB_LOG_VERBOSITY_SILENT, - XKB_LOG_VERBOSITY_VERBOSE, XKB_WARNING_CANNOT_INFER_KEY_TYPE, - XKB_WARNING_CONFLICTING_KEY_ACTION, XKB_WARNING_CONFLICTING_KEY_FIELDS, - XKB_WARNING_CONFLICTING_KEY_NAME, XKB_WARNING_CONFLICTING_KEY_SYMBOL, - XKB_WARNING_CONFLICTING_KEY_TYPE_DEFINITIONS, XKB_WARNING_CONFLICTING_KEY_TYPE_LEVEL_NAMES, - XKB_WARNING_CONFLICTING_KEY_TYPE_MAP_ENTRY, XKB_WARNING_CONFLICTING_KEY_TYPE_MERGING_GROUPS, - XKB_WARNING_CONFLICTING_KEY_TYPE_PRESERVE_ENTRIES, XKB_WARNING_CONFLICTING_MODMAP, - XKB_WARNING_DEPRECATED_KEYSYM, XKB_WARNING_DEPRECATED_KEYSYM_NAME, XKB_WARNING_DUPLICATE_ENTRY, - XKB_WARNING_EXTRA_SYMBOLS_IGNORED, XKB_WARNING_ILLEGAL_KEYCODE_ALIAS, - XKB_WARNING_ILLEGAL_KEY_TYPE_PRESERVE_RESULT, XKB_WARNING_INVALID_ESCAPE_SEQUENCE, - XKB_WARNING_INVALID_UNICODE_ESCAPE_SEQUENCE, XKB_WARNING_MISSING_DEFAULT_SECTION, - XKB_WARNING_MISSING_SYMBOLS_GROUP_NAME_INDEX, XKB_WARNING_MULTIPLE_GROUPS_AT_ONCE, - XKB_WARNING_NON_BASE_GROUP_NAME, XKB_WARNING_NUMERIC_KEYSYM, - XKB_WARNING_UNDECLARED_MODIFIERS_IN_KEY_TYPE, XKB_WARNING_UNDEFINED_KEYCODE, - XKB_WARNING_UNDEFINED_KEY_TYPE, XKB_WARNING_UNKNOWN_CHAR_ESCAPE_SEQUENCE, - XKB_WARNING_UNRECOGNIZED_KEYSYM, XKB_WARNING_UNRESOLVED_KEYMAP_SYMBOL, - XKB_WARNING_UNSUPPORTED_GEOMETRY_SECTION, XKB_WARNING_UNSUPPORTED_LEGACY_ACTION, - XKB_WARNING_UNSUPPORTED_SYMBOLS_FIELD, _XKB_LOG_MESSAGE_MAX_CODE, _XKB_LOG_MESSAGE_MIN_CODE, + XkbLevelsSameSyms, XkbWrapGroupIntoRange, }; pub use crate::shared_types::{ - entry_is_active, format_max_overlays, real_mod_index, xkb_action, xkb_action_flags, - xkb_controls_action, xkb_explicit_components, xkb_group, xkb_group_action, xkb_internal_action, - xkb_key, xkb_key_alias, xkb_key_type, xkb_key_type_entry, xkb_keymap, xkb_keysym_count_t, - xkb_led, xkb_level, xkb_mod, xkb_mod_action, xkb_mod_set, xkb_mods, xkb_overlay_index_t, - xkb_overlay_mask_t, xkb_pointer_action, xkb_pointer_button_action, xkb_pointer_default_action, - xkb_private_action, xkb_redirect_key_action, xkb_switch_screen_action, xkb_sym_interpret, - KeycodeMatch, ACTION_ABSOLUTE_SWITCH, ACTION_ABSOLUTE_X, ACTION_ABSOLUTE_Y, ACTION_ACCEL, + entry_is_active, xkb_action, xkb_action_flags, xkb_explicit_components, xkb_group, xkb_group_action, xkb_internal_action, + xkb_key, xkb_key_type, xkb_key_type_entry, xkb_keymap, xkb_level, xkb_mod_action, xkb_mods, xkb_redirect_key_action, ACTION_ABSOLUTE_SWITCH, ACTION_LATCH_ON_PRESS, ACTION_LATCH_TO_LOCK, ACTION_LOCK_CLEAR, ACTION_LOCK_NO_LOCK, - ACTION_LOCK_NO_UNLOCK, ACTION_LOCK_ON_RELEASE, ACTION_MODS_LOOKUP_MODMAP, - ACTION_PENDING_COMPUTATION, ACTION_SAME_SCREEN, ACTION_TYPE_CTRL_LOCK, ACTION_TYPE_CTRL_SET, - ACTION_TYPE_GROUP_LATCH, ACTION_TYPE_GROUP_LOCK, ACTION_TYPE_GROUP_SET, ACTION_TYPE_INTERNAL, - ACTION_TYPE_MOD_LATCH, ACTION_TYPE_MOD_LOCK, ACTION_TYPE_MOD_SET, ACTION_TYPE_NONE, - ACTION_TYPE_PRIVATE, ACTION_TYPE_PTR_BUTTON, ACTION_TYPE_PTR_DEFAULT, ACTION_TYPE_PTR_LOCK, - ACTION_TYPE_PTR_MOVE, ACTION_TYPE_REDIRECT_KEY, ACTION_TYPE_SWITCH_VT, ACTION_TYPE_TERMINATE, - ACTION_TYPE_UNKNOWN, ACTION_TYPE_UNSUPPORTED_LEGACY, ACTION_TYPE_VOID, ACTION_UNLOCK_ON_PRESS, - CONTROL_ALL, CONTROL_ALL_BOOLEAN, CONTROL_ALL_BOOLEAN_V1, CONTROL_ALL_V1, CONTROL_AX, - CONTROL_AX_FEEDBACK, CONTROL_AX_TIMEOUT, CONTROL_BELL, CONTROL_DEBOUNCE, CONTROL_GROUPS_WRAP, - CONTROL_IGNORE_GROUP_LOCK, CONTROL_MOUSE_KEYS, CONTROL_MOUSE_KEYS_ACCEL, CONTROL_OVERLAY1, - CONTROL_OVERLAY2, CONTROL_OVERLAY3, CONTROL_OVERLAY4, CONTROL_OVERLAY5, CONTROL_OVERLAY6, - CONTROL_OVERLAY7, CONTROL_OVERLAY8, CONTROL_REPEAT, CONTROL_SLOW, CONTROL_STICKY_KEYS, - EXPLICIT_INTERP, EXPLICIT_OVERLAY, EXPLICIT_REPEAT, EXPLICIT_SYMBOLS, EXPLICIT_TYPES, - EXPLICIT_VMODMAP, INTERNAL_BREAKS_GROUP_LATCH, INTERNAL_BREAKS_MOD_LATCH, MATCH_ALL, MATCH_ANY, - MATCH_ANY_OR_NONE, MATCH_EXACTLY, MATCH_NONE, MOD_BOTH, MOD_REAL, MOD_REAL_MASK_ALL, MOD_VIRT, - XKB_MAX_GROUPS, XKB_MOD_ALL, XKB_MOD_INDEX_CAPS, XKB_MOD_INDEX_CTRL, XKB_MOD_INDEX_MOD1, - XKB_MOD_INDEX_MOD2, XKB_MOD_INDEX_MOD3, XKB_MOD_INDEX_MOD4, XKB_MOD_INDEX_MOD5, - XKB_MOD_INDEX_SHIFT, XKB_OVERLAY1_CONTROLS_OFFSET, XKB_OVERLAY_MAX, XKB_OVERLAY_MAX_X11, + ACTION_LOCK_NO_UNLOCK, ACTION_LOCK_ON_RELEASE, ACTION_TYPE_CTRL_SET, + ACTION_TYPE_GROUP_LATCH, ACTION_TYPE_GROUP_SET, ACTION_TYPE_INTERNAL, + ACTION_TYPE_MOD_LATCH, ACTION_TYPE_MOD_SET, ACTION_TYPE_REDIRECT_KEY, ACTION_UNLOCK_ON_PRESS, CONTROL_STICKY_KEYS, INTERNAL_BREAKS_GROUP_LATCH, INTERNAL_BREAKS_MOD_LATCH, MOD_REAL_MASK_ALL, XKB_MOD_ALL, XKB_MOD_INDEX_CAPS, XKB_MOD_INDEX_CTRL, _ACTION_TYPE_NUM_ENTRIES, _XKB_MOD_INDEX_NUM_ENTRIES, }; -pub use crate::shared_types::{ - xkb_error_code, XKB_ERROR_ABI_BACKWARD_COMPAT, XKB_ERROR_ABI_FORWARD_COMPAT, - XKB_ERROR_ABI_INVALID_STRUCT_SIZE, XKB_ERROR_INVALID, XKB_ERROR_UNSUPPORTED_A11Y_FLAGS, - XKB_ERROR_UNSUPPORTED_LAYOUT_INDEX, XKB_ERROR_UNSUPPORTED_LAYOUT_OUT_OF_RANGE_POLICY, - XKB_ERROR_UNSUPPORTED_MODIFIER_MASK, XKB_SUCCESS, -}; fn vec_resize_zero(v: &mut Vec, new_len: usize) { v.resize_with(new_len, Default::default); diff --git a/xkb-core/src/text.rs b/xkb-core/src/text.rs index f5c0f07f..02518551 100644 --- a/xkb-core/src/text.rs +++ b/xkb-core/src/text.rs @@ -22,20 +22,17 @@ use crate::shared_types::XKB_KEYMAP_FORMAT_TEXT_V1; pub const XKB_KEYSYM_NAME_MAX_SIZE: i32 = 31; pub use crate::shared_types::{ - format_boolean_controls, xkb_action_controls, xkb_mod, xkb_mod_set, ACTION_TYPE_CTRL_LOCK, - ACTION_TYPE_CTRL_SET, ACTION_TYPE_GROUP_LATCH, ACTION_TYPE_GROUP_LOCK, ACTION_TYPE_GROUP_SET, - ACTION_TYPE_INTERNAL, ACTION_TYPE_MOD_LATCH, ACTION_TYPE_MOD_LOCK, ACTION_TYPE_MOD_SET, + xkb_mod_set, ACTION_TYPE_CTRL_LOCK, + ACTION_TYPE_CTRL_SET, ACTION_TYPE_GROUP_LATCH, ACTION_TYPE_GROUP_LOCK, ACTION_TYPE_GROUP_SET, ACTION_TYPE_MOD_LATCH, ACTION_TYPE_MOD_LOCK, ACTION_TYPE_MOD_SET, ACTION_TYPE_NONE, ACTION_TYPE_PRIVATE, ACTION_TYPE_PTR_BUTTON, ACTION_TYPE_PTR_DEFAULT, ACTION_TYPE_PTR_LOCK, ACTION_TYPE_PTR_MOVE, ACTION_TYPE_REDIRECT_KEY, ACTION_TYPE_SWITCH_VT, - ACTION_TYPE_TERMINATE, ACTION_TYPE_UNKNOWN, ACTION_TYPE_UNSUPPORTED_LEGACY, ACTION_TYPE_VOID, - CONTROL_ALL, CONTROL_ALL_BOOLEAN, CONTROL_ALL_BOOLEAN_V1, CONTROL_ALL_V1, CONTROL_AX, - CONTROL_AX_FEEDBACK, CONTROL_AX_TIMEOUT, CONTROL_BELL, CONTROL_DEBOUNCE, CONTROL_GROUPS_WRAP, + ACTION_TYPE_TERMINATE, ACTION_TYPE_UNSUPPORTED_LEGACY, ACTION_TYPE_VOID, CONTROL_ALL_BOOLEAN, CONTROL_ALL_BOOLEAN_V1, CONTROL_AX, + CONTROL_AX_FEEDBACK, CONTROL_AX_TIMEOUT, CONTROL_BELL, CONTROL_DEBOUNCE, CONTROL_IGNORE_GROUP_LOCK, CONTROL_MOUSE_KEYS, CONTROL_MOUSE_KEYS_ACCEL, CONTROL_OVERLAY1, CONTROL_OVERLAY2, CONTROL_OVERLAY3, CONTROL_OVERLAY4, CONTROL_OVERLAY5, CONTROL_OVERLAY6, CONTROL_OVERLAY7, CONTROL_OVERLAY8, CONTROL_REPEAT, CONTROL_SLOW, CONTROL_STICKY_KEYS, - MATCH_ALL, MATCH_ANY, MATCH_ANY_OR_NONE, MATCH_EXACTLY, MATCH_NONE, MOD_BOTH, MOD_REAL, - MOD_REAL_MASK_ALL, MOD_VIRT, XKB_ALL_GROUPS, XKB_MAX_GROUPS, XKB_MOD_NONE, - _ACTION_TYPE_NUM_ENTRIES, + MATCH_ALL, MATCH_ANY, MATCH_ANY_OR_NONE, MATCH_EXACTLY, MATCH_NONE, MOD_REAL, + MOD_REAL_MASK_ALL, XKB_ALL_GROUPS, XKB_MOD_NONE, }; pub fn LookupString(tab: &[LookupEntry], string: &str, value_rtrn: &mut u32) -> bool { if string.is_empty() { diff --git a/xkb-core/src/xkbcomp/ast_build.rs b/xkb-core/src/xkbcomp/ast_build.rs index 871773b8..985422df 100644 --- a/xkb-core/src/xkbcomp/ast_build.rs +++ b/xkb-core/src/xkbcomp/ast_build.rs @@ -1,66 +1,16 @@ pub use crate::keymap::XkbEscapeMapName; pub use crate::messages::{ - XKB_ERROR_ABI_BACKWARD_COMPAT_, XKB_ERROR_ABI_FORWARD_COMPAT_, - XKB_ERROR_ABI_INVALID_STRUCT_SIZE_, XKB_ERROR_ALLOCATION_ERROR, XKB_ERROR_CANNOT_RESOLVE_RMLVO, - XKB_ERROR_CONFLICTING_KEY_SYMBOLS_ENTRY, XKB_ERROR_EXPECTED_ARRAY_ENTRY, - XKB_ERROR_GLOBAL_DEFAULTS_WRONG_SCOPE, XKB_ERROR_INCLUDED_FILE_NOT_FOUND, - XKB_ERROR_INCOMPATIBLE_ACTIONS_AND_KEYSYMS_COUNT, XKB_ERROR_INCOMPATIBLE_KEYMAP_TEXT_FORMAT, - XKB_ERROR_INSUFFICIENT_BUFFER_SIZE, XKB_ERROR_INTEGER_OVERFLOW, XKB_ERROR_INVALID_ACTION_FIELD, - XKB_ERROR_INVALID_COMPOSE_LOCALE, XKB_ERROR_INVALID_COMPOSE_SYNTAX, - XKB_ERROR_INVALID_EXPRESSION_TYPE, XKB_ERROR_INVALID_FILE_ENCODING, - XKB_ERROR_INVALID_IDENTIFIER, XKB_ERROR_INVALID_INCLUDED_FILE, - XKB_ERROR_INVALID_INCLUDE_STATEMENT, XKB_ERROR_INVALID_MODMAP_ENTRY, - XKB_ERROR_INVALID_NUMERIC_KEYSYM, XKB_ERROR_INVALID_OPERATION, XKB_ERROR_INVALID_PATH, - XKB_ERROR_INVALID_REAL_MODIFIER, XKB_ERROR_INVALID_RULES_SYNTAX, - XKB_ERROR_INVALID_SET_DEFAULT_STATEMENT, XKB_ERROR_INVALID_VALUE, XKB_ERROR_INVALID_XKB_SYNTAX, - XKB_ERROR_KEYMAP_COMPILATION_FAILED, XKB_ERROR_MALFORMED_NUMBER_LITERAL, - XKB_ERROR_NO_VALID_DEFAULT_INCLUDE_PATH, XKB_ERROR_OVERLAPPING_OVERLAY, - XKB_ERROR_RECURSIVE_INCLUDE, XKB_ERROR_RULES_INVALID_LAYOUT_INDEX_PERCENT_EXPANSION, - XKB_ERROR_UNDECLARED_VIRTUAL_MODIFIER, XKB_ERROR_UNKNOWN_ACTION_TYPE, - XKB_ERROR_UNKNOWN_DEFAULT_FIELD, XKB_ERROR_UNKNOWN_FIELD, XKB_ERROR_UNKNOWN_OPERATOR, - XKB_ERROR_UNKNOWN_STATEMENT, XKB_ERROR_UNSUPPORTED_A11Y_FLAGS_, - XKB_ERROR_UNSUPPORTED_LAYOUT_INDEX_, XKB_ERROR_UNSUPPORTED_LAYOUT_OUT_OF_RANGE_POLICY_, - XKB_ERROR_UNSUPPORTED_MODIFIER_MASK_, XKB_ERROR_UNSUPPORTED_OVERLAY_INDEX, - XKB_ERROR_UNSUPPORTED_SHIFT_LEVEL, XKB_ERROR_WRONG_FIELD_TYPE, XKB_ERROR_WRONG_STATEMENT_TYPE, - XKB_WARNING_CANNOT_INFER_KEY_TYPE, XKB_WARNING_CONFLICTING_KEY_ACTION, - XKB_WARNING_CONFLICTING_KEY_FIELDS, XKB_WARNING_CONFLICTING_KEY_NAME, - XKB_WARNING_CONFLICTING_KEY_SYMBOL, XKB_WARNING_CONFLICTING_KEY_TYPE_DEFINITIONS, - XKB_WARNING_CONFLICTING_KEY_TYPE_LEVEL_NAMES, XKB_WARNING_CONFLICTING_KEY_TYPE_MAP_ENTRY, - XKB_WARNING_CONFLICTING_KEY_TYPE_MERGING_GROUPS, - XKB_WARNING_CONFLICTING_KEY_TYPE_PRESERVE_ENTRIES, XKB_WARNING_CONFLICTING_MODMAP, - XKB_WARNING_DEPRECATED_KEYSYM, XKB_WARNING_DEPRECATED_KEYSYM_NAME, XKB_WARNING_DUPLICATE_ENTRY, - XKB_WARNING_EXTRA_SYMBOLS_IGNORED, XKB_WARNING_ILLEGAL_KEYCODE_ALIAS, - XKB_WARNING_ILLEGAL_KEY_TYPE_PRESERVE_RESULT, XKB_WARNING_INVALID_ESCAPE_SEQUENCE, - XKB_WARNING_INVALID_UNICODE_ESCAPE_SEQUENCE, XKB_WARNING_MISSING_DEFAULT_SECTION, - XKB_WARNING_MISSING_SYMBOLS_GROUP_NAME_INDEX, XKB_WARNING_MULTIPLE_GROUPS_AT_ONCE, - XKB_WARNING_NON_BASE_GROUP_NAME, XKB_WARNING_NUMERIC_KEYSYM, - XKB_WARNING_UNDECLARED_MODIFIERS_IN_KEY_TYPE, XKB_WARNING_UNDEFINED_KEYCODE, - XKB_WARNING_UNDEFINED_KEY_TYPE, XKB_WARNING_UNKNOWN_CHAR_ESCAPE_SEQUENCE, - XKB_WARNING_UNRECOGNIZED_KEYSYM, XKB_WARNING_UNRESOLVED_KEYMAP_SYMBOL, - XKB_WARNING_UNSUPPORTED_GEOMETRY_SECTION, XKB_WARNING_UNSUPPORTED_LEGACY_ACTION, - XKB_WARNING_UNSUPPORTED_SYMBOLS_FIELD, _XKB_LOG_MESSAGE_MAX_CODE, _XKB_LOG_MESSAGE_MIN_CODE, + XKB_ERROR_INVALID_FILE_ENCODING, + XKB_ERROR_INVALID_INCLUDE_STATEMENT, }; -pub use crate::scanner_utils::{scanner, scanner_loc, sval}; +pub use crate::scanner_utils::scanner; pub use crate::shared_ast_types::{ merge_mode, stmt_type, xkb_map_flags, ExprDef, ExprKind, GroupCompatDef, IncludeStmt, InterpDef, KeyAliasDef, KeyTypeDef, KeycodeDef, LedMapDef, LedNameDef, ModMapDef, Statement, - SymbolsDef, UnknownStatement, VModDef, VarDef, XkbFile, _IncludeStmt, FILE_TYPE_COMPAT, - FILE_TYPE_GEOMETRY, FILE_TYPE_INVALID, FILE_TYPE_KEYCODES, FILE_TYPE_KEYMAP, FILE_TYPE_RULES, - FILE_TYPE_SYMBOLS, FILE_TYPE_TYPES, FIRST_KEYMAP_FILE_TYPE, LAST_KEYMAP_FILE_TYPE, - MAP_HAS_ALPHANUMERIC, MAP_HAS_FN, MAP_HAS_KEYPAD, MAP_HAS_MODIFIER, MAP_IS_ALTGR, - MAP_IS_DEFAULT, MAP_IS_HIDDEN, MAP_IS_PARTIAL, MERGE_AUGMENT, MERGE_DEFAULT, MERGE_OVERRIDE, - MERGE_REPLACE, STMT_ALIAS, STMT_EXPR_ACTION_DECL, STMT_EXPR_ACTION_LIST, STMT_EXPR_ADD, - STMT_EXPR_ARRAY_REF, STMT_EXPR_ASSIGN, STMT_EXPR_BOOLEAN_LITERAL, STMT_EXPR_DIVIDE, - STMT_EXPR_EMPTY_LIST, STMT_EXPR_FIELD_REF, STMT_EXPR_FLOAT_LITERAL, STMT_EXPR_IDENT, - STMT_EXPR_INTEGER_LITERAL, STMT_EXPR_INVERT, STMT_EXPR_KEYNAME_LITERAL, STMT_EXPR_KEYSYM_LIST, - STMT_EXPR_KEYSYM_LITERAL, STMT_EXPR_MULTIPLY, STMT_EXPR_NEGATE, STMT_EXPR_NOT, - STMT_EXPR_STRING_LITERAL, STMT_EXPR_SUBTRACT, STMT_EXPR_UNARY_PLUS, STMT_GROUP_COMPAT, - STMT_INCLUDE, STMT_INTERP, STMT_KEYCODE, STMT_LED_MAP, STMT_LED_NAME, STMT_MODMAP, - STMT_SYMBOLS, STMT_TYPE, STMT_UNKNOWN, STMT_UNKNOWN_COMPOUND, STMT_UNKNOWN_DECLARATION, - STMT_VAR, STMT_VMOD, _FILE_TYPE_NUM_ENTRIES, _MERGE_MODE_NUM_ENTRIES, _STMT_NUM_VALUES, + SymbolsDef, UnknownStatement, VModDef, VarDef, XkbFile, FILE_TYPE_KEYMAP, FIRST_KEYMAP_FILE_TYPE, LAST_KEYMAP_FILE_TYPE, MERGE_AUGMENT, MERGE_DEFAULT, MERGE_OVERRIDE, + MERGE_REPLACE, _STMT_NUM_VALUES, }; pub use crate::utf8_decoding::{utf8_next_code_point_safe, INVALID_UTF8_CODE_POINT}; -pub use crate::xkbcomp::include::{MERGE_AUGMENT_PREFIX, MERGE_REPLACE_PREFIX}; pub fn expr_create(kind: ExprKind) -> Box { Box::new(ExprDef { kind }) diff --git a/xkb-core/src/xkbcomp/include.rs b/xkb-core/src/xkbcomp/include.rs index 66a7cdc2..4e43c1fd 100644 --- a/xkb-core/src/xkbcomp/include.rs +++ b/xkb-core/src/xkbcomp/include.rs @@ -12,63 +12,13 @@ pub const MERGE_AUGMENT_PREFIX: i32 = '|' as i32; pub const MERGE_REPLACE_PREFIX: i32 = '^' as i32; pub use crate::messages::{ - XKB_ERROR_ABI_BACKWARD_COMPAT_, XKB_ERROR_ABI_FORWARD_COMPAT_, - XKB_ERROR_ABI_INVALID_STRUCT_SIZE_, XKB_ERROR_ALLOCATION_ERROR, XKB_ERROR_CANNOT_RESOLVE_RMLVO, - XKB_ERROR_CONFLICTING_KEY_SYMBOLS_ENTRY, XKB_ERROR_EXPECTED_ARRAY_ENTRY, - XKB_ERROR_GLOBAL_DEFAULTS_WRONG_SCOPE, XKB_ERROR_INCLUDED_FILE_NOT_FOUND, - XKB_ERROR_INCOMPATIBLE_ACTIONS_AND_KEYSYMS_COUNT, XKB_ERROR_INCOMPATIBLE_KEYMAP_TEXT_FORMAT, - XKB_ERROR_INSUFFICIENT_BUFFER_SIZE, XKB_ERROR_INTEGER_OVERFLOW, XKB_ERROR_INVALID_ACTION_FIELD, - XKB_ERROR_INVALID_COMPOSE_LOCALE, XKB_ERROR_INVALID_COMPOSE_SYNTAX, - XKB_ERROR_INVALID_EXPRESSION_TYPE, XKB_ERROR_INVALID_FILE_ENCODING, - XKB_ERROR_INVALID_IDENTIFIER, XKB_ERROR_INVALID_INCLUDED_FILE, - XKB_ERROR_INVALID_INCLUDE_STATEMENT, XKB_ERROR_INVALID_MODMAP_ENTRY, - XKB_ERROR_INVALID_NUMERIC_KEYSYM, XKB_ERROR_INVALID_OPERATION, XKB_ERROR_INVALID_PATH, - XKB_ERROR_INVALID_REAL_MODIFIER, XKB_ERROR_INVALID_RULES_SYNTAX, - XKB_ERROR_INVALID_SET_DEFAULT_STATEMENT, XKB_ERROR_INVALID_VALUE, XKB_ERROR_INVALID_XKB_SYNTAX, - XKB_ERROR_KEYMAP_COMPILATION_FAILED, XKB_ERROR_MALFORMED_NUMBER_LITERAL, - XKB_ERROR_NO_VALID_DEFAULT_INCLUDE_PATH, XKB_ERROR_OVERLAPPING_OVERLAY, - XKB_ERROR_RECURSIVE_INCLUDE, XKB_ERROR_RULES_INVALID_LAYOUT_INDEX_PERCENT_EXPANSION, - XKB_ERROR_UNDECLARED_VIRTUAL_MODIFIER, XKB_ERROR_UNKNOWN_ACTION_TYPE, - XKB_ERROR_UNKNOWN_DEFAULT_FIELD, XKB_ERROR_UNKNOWN_FIELD, XKB_ERROR_UNKNOWN_OPERATOR, - XKB_ERROR_UNKNOWN_STATEMENT, XKB_ERROR_UNSUPPORTED_A11Y_FLAGS_, - XKB_ERROR_UNSUPPORTED_LAYOUT_INDEX_, XKB_ERROR_UNSUPPORTED_LAYOUT_OUT_OF_RANGE_POLICY_, - XKB_ERROR_UNSUPPORTED_MODIFIER_MASK_, XKB_ERROR_UNSUPPORTED_OVERLAY_INDEX, - XKB_ERROR_UNSUPPORTED_SHIFT_LEVEL, XKB_ERROR_WRONG_FIELD_TYPE, XKB_ERROR_WRONG_STATEMENT_TYPE, - XKB_WARNING_CANNOT_INFER_KEY_TYPE, XKB_WARNING_CONFLICTING_KEY_ACTION, - XKB_WARNING_CONFLICTING_KEY_FIELDS, XKB_WARNING_CONFLICTING_KEY_NAME, - XKB_WARNING_CONFLICTING_KEY_SYMBOL, XKB_WARNING_CONFLICTING_KEY_TYPE_DEFINITIONS, - XKB_WARNING_CONFLICTING_KEY_TYPE_LEVEL_NAMES, XKB_WARNING_CONFLICTING_KEY_TYPE_MAP_ENTRY, - XKB_WARNING_CONFLICTING_KEY_TYPE_MERGING_GROUPS, - XKB_WARNING_CONFLICTING_KEY_TYPE_PRESERVE_ENTRIES, XKB_WARNING_CONFLICTING_MODMAP, - XKB_WARNING_DEPRECATED_KEYSYM, XKB_WARNING_DEPRECATED_KEYSYM_NAME, XKB_WARNING_DUPLICATE_ENTRY, - XKB_WARNING_EXTRA_SYMBOLS_IGNORED, XKB_WARNING_ILLEGAL_KEYCODE_ALIAS, - XKB_WARNING_ILLEGAL_KEY_TYPE_PRESERVE_RESULT, XKB_WARNING_INVALID_ESCAPE_SEQUENCE, - XKB_WARNING_INVALID_UNICODE_ESCAPE_SEQUENCE, XKB_WARNING_MISSING_DEFAULT_SECTION, - XKB_WARNING_MISSING_SYMBOLS_GROUP_NAME_INDEX, XKB_WARNING_MULTIPLE_GROUPS_AT_ONCE, - XKB_WARNING_NON_BASE_GROUP_NAME, XKB_WARNING_NUMERIC_KEYSYM, - XKB_WARNING_UNDECLARED_MODIFIERS_IN_KEY_TYPE, XKB_WARNING_UNDEFINED_KEYCODE, - XKB_WARNING_UNDEFINED_KEY_TYPE, XKB_WARNING_UNKNOWN_CHAR_ESCAPE_SEQUENCE, - XKB_WARNING_UNRECOGNIZED_KEYSYM, XKB_WARNING_UNRESOLVED_KEYMAP_SYMBOL, - XKB_WARNING_UNSUPPORTED_GEOMETRY_SECTION, XKB_WARNING_UNSUPPORTED_LEGACY_ACTION, - XKB_WARNING_UNSUPPORTED_SYMBOLS_FIELD, _XKB_LOG_MESSAGE_MAX_CODE, _XKB_LOG_MESSAGE_MIN_CODE, + XKB_ERROR_INCLUDED_FILE_NOT_FOUND, + XKB_ERROR_INSUFFICIENT_BUFFER_SIZE, XKB_ERROR_INVALID_INCLUDED_FILE, XKB_ERROR_INVALID_PATH, + XKB_ERROR_RECURSIVE_INCLUDE, }; -pub use crate::scanner_utils::{scanner, scanner_loc}; pub use crate::shared_ast_types::{ - _IncludeStmt, merge_mode, stmt_type, xkb_file_type_to_string, xkb_map_flags, IncludeStmt, - XkbFile, FILE_TYPE_COMPAT, FILE_TYPE_GEOMETRY, FILE_TYPE_INVALID, FILE_TYPE_KEYCODES, - FILE_TYPE_KEYMAP, FILE_TYPE_RULES, FILE_TYPE_SYMBOLS, FILE_TYPE_TYPES, FIRST_KEYMAP_FILE_TYPE, - LAST_KEYMAP_FILE_TYPE, MAP_HAS_ALPHANUMERIC, MAP_HAS_FN, MAP_HAS_KEYPAD, MAP_HAS_MODIFIER, - MAP_IS_ALTGR, MAP_IS_DEFAULT, MAP_IS_HIDDEN, MAP_IS_PARTIAL, MERGE_AUGMENT, MERGE_DEFAULT, - MERGE_OVERRIDE, MERGE_REPLACE, STMT_ALIAS, STMT_EXPR_ACTION_DECL, STMT_EXPR_ACTION_LIST, - STMT_EXPR_ADD, STMT_EXPR_ARRAY_REF, STMT_EXPR_ASSIGN, STMT_EXPR_BOOLEAN_LITERAL, - STMT_EXPR_DIVIDE, STMT_EXPR_EMPTY_LIST, STMT_EXPR_FIELD_REF, STMT_EXPR_FLOAT_LITERAL, - STMT_EXPR_IDENT, STMT_EXPR_INTEGER_LITERAL, STMT_EXPR_INVERT, STMT_EXPR_KEYNAME_LITERAL, - STMT_EXPR_KEYSYM_LIST, STMT_EXPR_KEYSYM_LITERAL, STMT_EXPR_MULTIPLY, STMT_EXPR_NEGATE, - STMT_EXPR_NOT, STMT_EXPR_STRING_LITERAL, STMT_EXPR_SUBTRACT, STMT_EXPR_UNARY_PLUS, - STMT_GROUP_COMPAT, STMT_INCLUDE, STMT_INTERP, STMT_KEYCODE, STMT_LED_MAP, STMT_LED_NAME, - STMT_MODMAP, STMT_SYMBOLS, STMT_TYPE, STMT_UNKNOWN, STMT_UNKNOWN_COMPOUND, - STMT_UNKNOWN_DECLARATION, STMT_VAR, STMT_VMOD, _FILE_TYPE_NUM_ENTRIES, _MERGE_MODE_NUM_ENTRIES, - _STMT_NUM_VALUES, + xkb_file_type_to_string, IncludeStmt, + XkbFile, MAP_IS_DEFAULT, }; use crate::xkbcomp::scanner::XkbParseFile; diff --git a/xkb-core/src/xkbcomp/keymap.rs b/xkb-core/src/xkbcomp/keymap.rs index e2edc577..85c04734 100644 --- a/xkb-core/src/xkbcomp/keymap.rs +++ b/xkb-core/src/xkbcomp/keymap.rs @@ -2,11 +2,7 @@ use super::prelude::*; pub use crate::shared_ast_types::xkb_file_type_to_string; pub use crate::shared_types::{ areOverlappingOverlaysSupported, format_max_groups, format_max_overlays, - isGroupLockOnReleaseSupported, isModsLatchOnPressSupported, isModsUnLockOnPressSupported, - real_mod_index, MAX_ACTIONS_PER_LEVEL, XKB_ALL_GROUPS, XKB_MAX_GROUPS, XKB_MAX_GROUPS_X11, - XKB_MOD_INDEX_CAPS, XKB_MOD_INDEX_CTRL, XKB_MOD_INDEX_MOD1, XKB_MOD_INDEX_MOD2, - XKB_MOD_INDEX_MOD3, XKB_MOD_INDEX_MOD4, XKB_MOD_INDEX_MOD5, XKB_MOD_INDEX_SHIFT, - XKB_OVERLAY_MAX, XKB_OVERLAY_MAX_X11, _XKB_MOD_INDEX_NUM_ENTRIES, + isGroupLockOnReleaseSupported, isModsLatchOnPressSupported, isModsUnLockOnPressSupported, MAX_ACTIONS_PER_LEVEL, XKB_ALL_GROUPS, XKB_MAX_GROUPS, _XKB_MOD_INDEX_NUM_ENTRIES, }; use crate::shared_types::{MOD_REAL_MASK_ALL, XKB_KEYMAP_FORMAT_TEXT_V1}; pub use crate::state::mod_mask_get_effective; diff --git a/xkb-core/src/xkbcomp/keywords.rs b/xkb-core/src/xkbcomp/keywords.rs index cdf3db7b..4d8e2225 100644 --- a/xkb-core/src/xkbcomp/keywords.rs +++ b/xkb-core/src/xkbcomp/keywords.rs @@ -1,11 +1,7 @@ pub use super::scanner::parser_h::{ - YYerror, ACTION_TOK, ALIAS, ALPHANUMERIC_KEYS, ALTERNATE, ALTERNATE_GROUP, AUGMENT, CBRACE, - CBRACKET, COMMA, CPAREN, DECIMAL_DIGIT, DEFAULT, DIVIDE, DOT, END_OF_FILE, EQUALS, ERROR_TOK, - EXCLAM, FLOAT, FUNCTION_KEYS, GROUP, HIDDEN, IDENT, INCLUDE, INDICATOR, INTEGER, INTERPRET, - INVERT, KEY, KEYNAME, KEYPAD_KEYS, KEYS, LOGO, MINUS, MODIFIER_KEYS, MODIFIER_MAP, OBRACE, - OBRACKET, OPAREN, OUTLINE, OVERLAY, OVERRIDE, PARTIAL, PLUS, REPLACE, ROW, SECTION, SEMI, - SHAPE, SOLID, STRING, TEXT, TIMES, TYPE, VIRTUAL, VIRTUAL_MODS, XKB_COMPATMAP, XKB_GEOMETRY, - XKB_KEYCODES, XKB_KEYMAP, XKB_LAYOUT, XKB_SEMANTICS, XKB_SYMBOLS, XKB_TYPES, YYEMPTY, YYUNDEF, + ACTION_TOK, ALIAS, ALPHANUMERIC_KEYS, ALTERNATE, ALTERNATE_GROUP, AUGMENT, DEFAULT, FUNCTION_KEYS, GROUP, HIDDEN, INCLUDE, INDICATOR, INTERPRET, KEY, KEYPAD_KEYS, KEYS, LOGO, MODIFIER_KEYS, MODIFIER_MAP, OUTLINE, OVERLAY, OVERRIDE, PARTIAL, REPLACE, ROW, SECTION, + SHAPE, SOLID, TEXT, TYPE, VIRTUAL, VIRTUAL_MODS, XKB_COMPATMAP, XKB_GEOMETRY, + XKB_KEYCODES, XKB_KEYMAP, XKB_LAYOUT, XKB_SEMANTICS, XKB_SYMBOLS, XKB_TYPES, }; pub const MAX_HASH_VALUE: u32 = 72; diff --git a/xkb-core/src/xkbcomp/parser.rs b/xkb-core/src/xkbcomp/parser.rs index 49314ceb..6ddd5318 100644 --- a/xkb-core/src/xkbcomp/parser.rs +++ b/xkb-core/src/xkbcomp/parser.rs @@ -31,13 +31,7 @@ use crate::messages::{ }; pub use super::scanner::parser_h::{ - YYerror, ACTION_TOK, ALIAS, ALPHANUMERIC_KEYS, ALTERNATE, ALTERNATE_GROUP, AUGMENT, CBRACE, - CBRACKET, COMMA, CPAREN, DECIMAL_DIGIT, DEFAULT, DIVIDE, DOT, END_OF_FILE, EQUALS, ERROR_TOK, - EXCLAM, FLOAT, FUNCTION_KEYS, GROUP, HIDDEN, IDENT, INCLUDE, INDICATOR, INTEGER, INTERPRET, - INVERT, KEY, KEYNAME, KEYPAD_KEYS, KEYS, LOGO, MINUS, MODIFIER_KEYS, MODIFIER_MAP, OBRACE, - OBRACKET, OPAREN, OUTLINE, OVERLAY, OVERRIDE, PARTIAL, PLUS, REPLACE, ROW, SECTION, SEMI, - SHAPE, SOLID, STRING, TEXT, TIMES, TYPE, VIRTUAL, VIRTUAL_MODS, XKB_COMPATMAP, XKB_GEOMETRY, - XKB_KEYCODES, XKB_KEYMAP, XKB_LAYOUT, XKB_SEMANTICS, XKB_SYMBOLS, XKB_TYPES, YYEMPTY, YYUNDEF, + YYerror, END_OF_FILE, YYEMPTY, YYUNDEF, }; pub const XKB_KEY_VoidSymbol: i32 = 0xffffff_i32; diff --git a/xkb-core/src/xkbcomp/prelude.rs b/xkb-core/src/xkbcomp/prelude.rs index fa2d02f0..01ec8a6d 100644 --- a/xkb-core/src/xkbcomp/prelude.rs +++ b/xkb-core/src/xkbcomp/prelude.rs @@ -5,34 +5,23 @@ // context pub use crate::context::xkb_atom_text; -pub use crate::context::xkb_context_get_log_verbosity; // keymap pub use crate::keymap::xkb_escape_map_name; -pub use crate::keymap::XkbEscapeMapName; // messages pub use crate::messages::{ - XKB_ERROR_ABI_BACKWARD_COMPAT_, XKB_ERROR_ABI_FORWARD_COMPAT_, - XKB_ERROR_ABI_INVALID_STRUCT_SIZE_, XKB_ERROR_ALLOCATION_ERROR, XKB_ERROR_CANNOT_RESOLVE_RMLVO, - XKB_ERROR_CONFLICTING_KEY_SYMBOLS_ENTRY, XKB_ERROR_EXPECTED_ARRAY_ENTRY, - XKB_ERROR_GLOBAL_DEFAULTS_WRONG_SCOPE, XKB_ERROR_INCLUDED_FILE_NOT_FOUND, - XKB_ERROR_INCOMPATIBLE_ACTIONS_AND_KEYSYMS_COUNT, XKB_ERROR_INCOMPATIBLE_KEYMAP_TEXT_FORMAT, - XKB_ERROR_INSUFFICIENT_BUFFER_SIZE, XKB_ERROR_INTEGER_OVERFLOW, XKB_ERROR_INVALID_ACTION_FIELD, - XKB_ERROR_INVALID_COMPOSE_LOCALE, XKB_ERROR_INVALID_COMPOSE_SYNTAX, - XKB_ERROR_INVALID_EXPRESSION_TYPE, XKB_ERROR_INVALID_FILE_ENCODING, - XKB_ERROR_INVALID_IDENTIFIER, XKB_ERROR_INVALID_INCLUDED_FILE, - XKB_ERROR_INVALID_INCLUDE_STATEMENT, XKB_ERROR_INVALID_MODMAP_ENTRY, - XKB_ERROR_INVALID_NUMERIC_KEYSYM, XKB_ERROR_INVALID_OPERATION, XKB_ERROR_INVALID_PATH, - XKB_ERROR_INVALID_REAL_MODIFIER, XKB_ERROR_INVALID_RULES_SYNTAX, - XKB_ERROR_INVALID_SET_DEFAULT_STATEMENT, XKB_ERROR_INVALID_VALUE, XKB_ERROR_INVALID_XKB_SYNTAX, - XKB_ERROR_KEYMAP_COMPILATION_FAILED, XKB_ERROR_MALFORMED_NUMBER_LITERAL, - XKB_ERROR_NO_VALID_DEFAULT_INCLUDE_PATH, XKB_ERROR_OVERLAPPING_OVERLAY, - XKB_ERROR_RECURSIVE_INCLUDE, XKB_ERROR_RULES_INVALID_LAYOUT_INDEX_PERCENT_EXPANSION, + XKB_ERROR_ALLOCATION_ERROR, + XKB_ERROR_CONFLICTING_KEY_SYMBOLS_ENTRY, + XKB_ERROR_GLOBAL_DEFAULTS_WRONG_SCOPE, XKB_ERROR_INCOMPATIBLE_KEYMAP_TEXT_FORMAT, XKB_ERROR_INTEGER_OVERFLOW, XKB_ERROR_INVALID_ACTION_FIELD, + XKB_ERROR_INVALID_EXPRESSION_TYPE, + XKB_ERROR_INVALID_IDENTIFIER, XKB_ERROR_INVALID_MODMAP_ENTRY, XKB_ERROR_INVALID_OPERATION, + XKB_ERROR_INVALID_REAL_MODIFIER, + XKB_ERROR_INVALID_SET_DEFAULT_STATEMENT, XKB_ERROR_INVALID_VALUE, XKB_ERROR_INVALID_XKB_SYNTAX, XKB_ERROR_OVERLAPPING_OVERLAY, XKB_ERROR_UNDECLARED_VIRTUAL_MODIFIER, XKB_ERROR_UNKNOWN_ACTION_TYPE, XKB_ERROR_UNKNOWN_DEFAULT_FIELD, XKB_ERROR_UNKNOWN_FIELD, XKB_ERROR_UNKNOWN_OPERATOR, - XKB_ERROR_UNKNOWN_STATEMENT, XKB_ERROR_UNSUPPORTED_A11Y_FLAGS_, - XKB_ERROR_UNSUPPORTED_LAYOUT_INDEX_, XKB_ERROR_UNSUPPORTED_LAYOUT_OUT_OF_RANGE_POLICY_, + XKB_ERROR_UNKNOWN_STATEMENT, + XKB_ERROR_UNSUPPORTED_LAYOUT_INDEX_, XKB_ERROR_UNSUPPORTED_MODIFIER_MASK_, XKB_ERROR_UNSUPPORTED_OVERLAY_INDEX, XKB_ERROR_UNSUPPORTED_SHIFT_LEVEL, XKB_ERROR_WRONG_FIELD_TYPE, XKB_ERROR_WRONG_STATEMENT_TYPE, XKB_WARNING_CANNOT_INFER_KEY_TYPE, XKB_WARNING_CONFLICTING_KEY_ACTION, @@ -40,80 +29,54 @@ pub use crate::messages::{ XKB_WARNING_CONFLICTING_KEY_SYMBOL, XKB_WARNING_CONFLICTING_KEY_TYPE_DEFINITIONS, XKB_WARNING_CONFLICTING_KEY_TYPE_LEVEL_NAMES, XKB_WARNING_CONFLICTING_KEY_TYPE_MAP_ENTRY, XKB_WARNING_CONFLICTING_KEY_TYPE_MERGING_GROUPS, - XKB_WARNING_CONFLICTING_KEY_TYPE_PRESERVE_ENTRIES, XKB_WARNING_CONFLICTING_MODMAP, - XKB_WARNING_DEPRECATED_KEYSYM, XKB_WARNING_DEPRECATED_KEYSYM_NAME, XKB_WARNING_DUPLICATE_ENTRY, - XKB_WARNING_EXTRA_SYMBOLS_IGNORED, XKB_WARNING_ILLEGAL_KEYCODE_ALIAS, - XKB_WARNING_ILLEGAL_KEY_TYPE_PRESERVE_RESULT, XKB_WARNING_INVALID_ESCAPE_SEQUENCE, - XKB_WARNING_INVALID_UNICODE_ESCAPE_SEQUENCE, XKB_WARNING_MISSING_DEFAULT_SECTION, + XKB_WARNING_CONFLICTING_KEY_TYPE_PRESERVE_ENTRIES, XKB_WARNING_CONFLICTING_MODMAP, XKB_WARNING_DUPLICATE_ENTRY, + XKB_WARNING_EXTRA_SYMBOLS_IGNORED, + XKB_WARNING_ILLEGAL_KEY_TYPE_PRESERVE_RESULT, XKB_WARNING_MISSING_SYMBOLS_GROUP_NAME_INDEX, XKB_WARNING_MULTIPLE_GROUPS_AT_ONCE, - XKB_WARNING_NON_BASE_GROUP_NAME, XKB_WARNING_NUMERIC_KEYSYM, + XKB_WARNING_NON_BASE_GROUP_NAME, XKB_WARNING_UNDECLARED_MODIFIERS_IN_KEY_TYPE, XKB_WARNING_UNDEFINED_KEYCODE, - XKB_WARNING_UNDEFINED_KEY_TYPE, XKB_WARNING_UNKNOWN_CHAR_ESCAPE_SEQUENCE, - XKB_WARNING_UNRECOGNIZED_KEYSYM, XKB_WARNING_UNRESOLVED_KEYMAP_SYMBOL, + XKB_WARNING_UNDEFINED_KEY_TYPE, XKB_WARNING_UNRESOLVED_KEYMAP_SYMBOL, XKB_WARNING_UNSUPPORTED_GEOMETRY_SECTION, XKB_WARNING_UNSUPPORTED_LEGACY_ACTION, - XKB_WARNING_UNSUPPORTED_SYMBOLS_FIELD, _XKB_LOG_MESSAGE_MAX_CODE, _XKB_LOG_MESSAGE_MIN_CODE, + XKB_WARNING_UNSUPPORTED_SYMBOLS_FIELD, }; // shared_ast_types pub use crate::shared_ast_types::{ - _IncludeStmt, merge_mode, pending_computation, safe_map_name, stmt_type, stmt_type_to_string, - xkb_keymap_info, xkb_map_flags, ExprDef, ExprKind, IncludeStmt, ReportBadType, Statement, - UnknownStatement, VModDef, VarDef, XkbFile, XkbcompFeatures, XkbcompLookup, FILE_TYPE_COMPAT, - FILE_TYPE_GEOMETRY, FILE_TYPE_INVALID, FILE_TYPE_KEYCODES, FILE_TYPE_KEYMAP, FILE_TYPE_RULES, - FILE_TYPE_SYMBOLS, FILE_TYPE_TYPES, FIRST_KEYMAP_FILE_TYPE, LAST_KEYMAP_FILE_TYPE, - MAP_HAS_ALPHANUMERIC, MAP_HAS_FN, MAP_HAS_KEYPAD, MAP_HAS_MODIFIER, MAP_IS_ALTGR, - MAP_IS_DEFAULT, MAP_IS_HIDDEN, MAP_IS_PARTIAL, MERGE_AUGMENT, MERGE_DEFAULT, MERGE_OVERRIDE, + merge_mode, pending_computation, safe_map_name, stmt_type_to_string, + xkb_keymap_info, ExprDef, ExprKind, IncludeStmt, ReportBadType, Statement, VarDef, XkbFile, XkbcompFeatures, XkbcompLookup, FILE_TYPE_COMPAT, + FILE_TYPE_GEOMETRY, FILE_TYPE_KEYCODES, + FILE_TYPE_SYMBOLS, FILE_TYPE_TYPES, FIRST_KEYMAP_FILE_TYPE, LAST_KEYMAP_FILE_TYPE, MERGE_AUGMENT, MERGE_DEFAULT, MERGE_OVERRIDE, MERGE_REPLACE, PARSER_FATAL_ERROR, PARSER_NO_FIELD_TYPE_MISMATCH, - PARSER_NO_FIELD_VALUE_MISMATCH, PARSER_NO_ILLEGAL_ACTION_FIELDS, PARSER_NO_STRICT_FLAGS, + PARSER_NO_FIELD_VALUE_MISMATCH, PARSER_NO_ILLEGAL_ACTION_FIELDS, PARSER_NO_UNKNOWN_ACTION, PARSER_NO_UNKNOWN_ACTION_FIELDS, PARSER_NO_UNKNOWN_COMPAT_GLOBAL_FIELDS, PARSER_NO_UNKNOWN_INTERPRET_FIELDS, PARSER_NO_UNKNOWN_KEYCODES_GLOBAL_FIELDS, PARSER_NO_UNKNOWN_KEY_FIELDS, PARSER_NO_UNKNOWN_LED_FIELDS, PARSER_NO_UNKNOWN_STATEMENTS, PARSER_NO_UNKNOWN_SYMBOLS_GLOBAL_FIELDS, PARSER_NO_UNKNOWN_TYPES_GLOBAL_FIELDS, PARSER_NO_UNKNOWN_TYPE_FIELDS, PARSER_RECOVERABLE_ERROR, PARSER_SUCCESS, PARSER_V1_LAX_FLAGS, - PARSER_V1_STRICT_FLAGS, PARSER_V2_LAX_FLAGS, PARSER_V2_STRICT_FLAGS, STMT_ALIAS, - STMT_EXPR_ACTION_DECL, STMT_EXPR_ACTION_LIST, STMT_EXPR_ADD, STMT_EXPR_ARRAY_REF, - STMT_EXPR_ASSIGN, STMT_EXPR_BOOLEAN_LITERAL, STMT_EXPR_DIVIDE, STMT_EXPR_EMPTY_LIST, - STMT_EXPR_FIELD_REF, STMT_EXPR_FLOAT_LITERAL, STMT_EXPR_IDENT, STMT_EXPR_INTEGER_LITERAL, - STMT_EXPR_INVERT, STMT_EXPR_KEYNAME_LITERAL, STMT_EXPR_KEYSYM_LIST, STMT_EXPR_KEYSYM_LITERAL, - STMT_EXPR_MULTIPLY, STMT_EXPR_NEGATE, STMT_EXPR_NOT, STMT_EXPR_STRING_LITERAL, - STMT_EXPR_SUBTRACT, STMT_EXPR_UNARY_PLUS, STMT_GROUP_COMPAT, STMT_INCLUDE, STMT_INTERP, - STMT_KEYCODE, STMT_LED_MAP, STMT_LED_NAME, STMT_MODMAP, STMT_SYMBOLS, STMT_TYPE, STMT_UNKNOWN, - STMT_UNKNOWN_COMPOUND, STMT_UNKNOWN_DECLARATION, STMT_VAR, STMT_VMOD, _FILE_TYPE_NUM_ENTRIES, - _MERGE_MODE_NUM_ENTRIES, _STMT_NUM_VALUES, + PARSER_V1_STRICT_FLAGS, PARSER_V2_LAX_FLAGS, PARSER_V2_STRICT_FLAGS, + STMT_EXPR_ACTION_DECL, STMT_EXPR_ACTION_LIST, + STMT_EXPR_ASSIGN, STMT_EXPR_DIVIDE, STMT_EXPR_EMPTY_LIST, STMT_EXPR_IDENT, + STMT_EXPR_INVERT, STMT_EXPR_KEYNAME_LITERAL, STMT_EXPR_KEYSYM_LIST, STMT_EXPR_KEYSYM_LITERAL, STMT_EXPR_NEGATE, STMT_EXPR_NOT, STMT_EXPR_UNARY_PLUS, + STMT_UNKNOWN_COMPOUND, }; // shared_types pub use crate::shared_types::{ - xkb_action, xkb_action_controls, xkb_action_flags, xkb_controls_action, xkb_error_code, - xkb_explicit_components, xkb_group, xkb_group_action, xkb_internal_action, xkb_key, - xkb_key_alias, xkb_key_type, xkb_key_type_entry, xkb_keymap, xkb_keysym_count_t, xkb_led, - xkb_level, xkb_mod, xkb_mod_action, xkb_mod_set, xkb_mods, xkb_overlay_index_t, - xkb_overlay_mask_t, xkb_pointer_action, xkb_pointer_button_action, xkb_pointer_default_action, - xkb_private_action, xkb_redirect_key_action, xkb_switch_screen_action, xkb_sym_interpret, - KeycodeMatch, ACTION_ABSOLUTE_SWITCH, ACTION_ABSOLUTE_X, ACTION_ABSOLUTE_Y, ACTION_ACCEL, + xkb_action_controls, xkb_action_flags, + xkb_explicit_components, xkb_keymap, xkb_overlay_index_t, + xkb_overlay_mask_t, ACTION_ABSOLUTE_SWITCH, ACTION_ABSOLUTE_X, ACTION_ABSOLUTE_Y, ACTION_ACCEL, ACTION_LATCH_ON_PRESS, ACTION_LATCH_TO_LOCK, ACTION_LOCK_CLEAR, ACTION_LOCK_NO_LOCK, ACTION_LOCK_NO_UNLOCK, ACTION_LOCK_ON_RELEASE, ACTION_MODS_LOOKUP_MODMAP, - ACTION_PENDING_COMPUTATION, ACTION_SAME_SCREEN, ACTION_TYPE_CTRL_LOCK, ACTION_TYPE_CTRL_SET, - ACTION_TYPE_GROUP_LATCH, ACTION_TYPE_GROUP_LOCK, ACTION_TYPE_GROUP_SET, ACTION_TYPE_INTERNAL, + ACTION_PENDING_COMPUTATION, ACTION_SAME_SCREEN, ACTION_TYPE_CTRL_LOCK, + ACTION_TYPE_GROUP_LATCH, ACTION_TYPE_GROUP_LOCK, ACTION_TYPE_GROUP_SET, ACTION_TYPE_MOD_LATCH, ACTION_TYPE_MOD_LOCK, ACTION_TYPE_MOD_SET, ACTION_TYPE_NONE, - ACTION_TYPE_PRIVATE, ACTION_TYPE_PTR_BUTTON, ACTION_TYPE_PTR_DEFAULT, ACTION_TYPE_PTR_LOCK, - ACTION_TYPE_PTR_MOVE, ACTION_TYPE_REDIRECT_KEY, ACTION_TYPE_SWITCH_VT, ACTION_TYPE_TERMINATE, - ACTION_TYPE_UNKNOWN, ACTION_TYPE_UNSUPPORTED_LEGACY, ACTION_TYPE_VOID, ACTION_UNLOCK_ON_PRESS, - CONTROL_ALL, CONTROL_ALL_BOOLEAN, CONTROL_ALL_BOOLEAN_V1, CONTROL_ALL_V1, CONTROL_AX, - CONTROL_AX_FEEDBACK, CONTROL_AX_TIMEOUT, CONTROL_BELL, CONTROL_DEBOUNCE, CONTROL_GROUPS_WRAP, - CONTROL_IGNORE_GROUP_LOCK, CONTROL_MOUSE_KEYS, CONTROL_MOUSE_KEYS_ACCEL, CONTROL_OVERLAY1, - CONTROL_OVERLAY2, CONTROL_OVERLAY3, CONTROL_OVERLAY4, CONTROL_OVERLAY5, CONTROL_OVERLAY6, - CONTROL_OVERLAY7, CONTROL_OVERLAY8, CONTROL_REPEAT, CONTROL_SLOW, CONTROL_STICKY_KEYS, - DEFAULT_INTERPRET_KEY_REPEAT, DEFAULT_INTERPRET_VMOD, DEFAULT_INTERPRET_VMODMAP, - DEFAULT_KEY_REPEAT, DEFAULT_KEY_VMODMAP, EXPLICIT_INTERP, EXPLICIT_OVERLAY, EXPLICIT_REPEAT, - EXPLICIT_SYMBOLS, EXPLICIT_TYPES, EXPLICIT_VMODMAP, FALLBACK_INTERPRET_KEY_REPEAT, - FALLBACK_INTERPRET_VMODMAP, INTERNAL_BREAKS_GROUP_LATCH, INTERNAL_BREAKS_MOD_LATCH, MATCH_ALL, - MATCH_ANY, MATCH_ANY_OR_NONE, MATCH_EXACTLY, MATCH_NONE, MOD_BOTH, MOD_REAL, MOD_VIRT, - XKB_ERROR_ABI_BACKWARD_COMPAT, XKB_ERROR_ABI_FORWARD_COMPAT, XKB_ERROR_ABI_INVALID_STRUCT_SIZE, - XKB_ERROR_INVALID, XKB_ERROR_UNSUPPORTED_A11Y_FLAGS, XKB_ERROR_UNSUPPORTED_LAYOUT_INDEX, - XKB_ERROR_UNSUPPORTED_LAYOUT_OUT_OF_RANGE_POLICY, XKB_ERROR_UNSUPPORTED_MODIFIER_MASK, - XKB_SUCCESS, _ACTION_TYPE_NUM_ENTRIES, + ACTION_TYPE_PRIVATE, ACTION_TYPE_PTR_DEFAULT, ACTION_TYPE_PTR_LOCK, + ACTION_TYPE_PTR_MOVE, ACTION_TYPE_REDIRECT_KEY, ACTION_TYPE_SWITCH_VT, + ACTION_TYPE_UNKNOWN, ACTION_TYPE_UNSUPPORTED_LEGACY, ACTION_UNLOCK_ON_PRESS, + DEFAULT_INTERPRET_KEY_REPEAT, DEFAULT_INTERPRET_VMOD, EXPLICIT_INTERP, EXPLICIT_OVERLAY, EXPLICIT_REPEAT, + EXPLICIT_SYMBOLS, EXPLICIT_TYPES, EXPLICIT_VMODMAP, MATCH_ALL, + MATCH_ANY, MATCH_ANY_OR_NONE, MATCH_EXACTLY, MATCH_NONE, MOD_BOTH, MOD_REAL, MOD_VIRT, XKB_ERROR_UNSUPPORTED_LAYOUT_INDEX, XKB_ERROR_UNSUPPORTED_MODIFIER_MASK, _ACTION_TYPE_NUM_ENTRIES, }; // text diff --git a/xkb-core/src/xkbcomp/rules.rs b/xkb-core/src/xkbcomp/rules.rs index 1c7507ad..87cad0b6 100644 --- a/xkb-core/src/xkbcomp/rules.rs +++ b/xkb-core/src/xkbcomp/rules.rs @@ -1,62 +1,12 @@ pub const OPTIONS_GROUP_SPECIFIER_PREFIX: i32 = '!' as i32; pub use crate::messages::{ - XKB_ERROR_ABI_BACKWARD_COMPAT_, XKB_ERROR_ABI_FORWARD_COMPAT_, - XKB_ERROR_ABI_INVALID_STRUCT_SIZE_, XKB_ERROR_ALLOCATION_ERROR, XKB_ERROR_CANNOT_RESOLVE_RMLVO, - XKB_ERROR_CONFLICTING_KEY_SYMBOLS_ENTRY, XKB_ERROR_EXPECTED_ARRAY_ENTRY, - XKB_ERROR_GLOBAL_DEFAULTS_WRONG_SCOPE, XKB_ERROR_INCLUDED_FILE_NOT_FOUND, - XKB_ERROR_INCOMPATIBLE_ACTIONS_AND_KEYSYMS_COUNT, XKB_ERROR_INCOMPATIBLE_KEYMAP_TEXT_FORMAT, - XKB_ERROR_INSUFFICIENT_BUFFER_SIZE, XKB_ERROR_INTEGER_OVERFLOW, XKB_ERROR_INVALID_ACTION_FIELD, - XKB_ERROR_INVALID_COMPOSE_LOCALE, XKB_ERROR_INVALID_COMPOSE_SYNTAX, - XKB_ERROR_INVALID_EXPRESSION_TYPE, XKB_ERROR_INVALID_FILE_ENCODING, - XKB_ERROR_INVALID_IDENTIFIER, XKB_ERROR_INVALID_INCLUDED_FILE, - XKB_ERROR_INVALID_INCLUDE_STATEMENT, XKB_ERROR_INVALID_MODMAP_ENTRY, - XKB_ERROR_INVALID_NUMERIC_KEYSYM, XKB_ERROR_INVALID_OPERATION, XKB_ERROR_INVALID_PATH, - XKB_ERROR_INVALID_REAL_MODIFIER, XKB_ERROR_INVALID_RULES_SYNTAX, - XKB_ERROR_INVALID_SET_DEFAULT_STATEMENT, XKB_ERROR_INVALID_VALUE, XKB_ERROR_INVALID_XKB_SYNTAX, - XKB_ERROR_KEYMAP_COMPILATION_FAILED, XKB_ERROR_MALFORMED_NUMBER_LITERAL, - XKB_ERROR_NO_VALID_DEFAULT_INCLUDE_PATH, XKB_ERROR_OVERLAPPING_OVERLAY, - XKB_ERROR_RECURSIVE_INCLUDE, XKB_ERROR_RULES_INVALID_LAYOUT_INDEX_PERCENT_EXPANSION, - XKB_ERROR_UNDECLARED_VIRTUAL_MODIFIER, XKB_ERROR_UNKNOWN_ACTION_TYPE, - XKB_ERROR_UNKNOWN_DEFAULT_FIELD, XKB_ERROR_UNKNOWN_FIELD, XKB_ERROR_UNKNOWN_OPERATOR, - XKB_ERROR_UNKNOWN_STATEMENT, XKB_ERROR_UNSUPPORTED_A11Y_FLAGS_, - XKB_ERROR_UNSUPPORTED_LAYOUT_INDEX_, XKB_ERROR_UNSUPPORTED_LAYOUT_OUT_OF_RANGE_POLICY_, - XKB_ERROR_UNSUPPORTED_MODIFIER_MASK_, XKB_ERROR_UNSUPPORTED_OVERLAY_INDEX, - XKB_ERROR_UNSUPPORTED_SHIFT_LEVEL, XKB_ERROR_WRONG_FIELD_TYPE, XKB_ERROR_WRONG_STATEMENT_TYPE, - XKB_WARNING_CANNOT_INFER_KEY_TYPE, XKB_WARNING_CONFLICTING_KEY_ACTION, - XKB_WARNING_CONFLICTING_KEY_FIELDS, XKB_WARNING_CONFLICTING_KEY_NAME, - XKB_WARNING_CONFLICTING_KEY_SYMBOL, XKB_WARNING_CONFLICTING_KEY_TYPE_DEFINITIONS, - XKB_WARNING_CONFLICTING_KEY_TYPE_LEVEL_NAMES, XKB_WARNING_CONFLICTING_KEY_TYPE_MAP_ENTRY, - XKB_WARNING_CONFLICTING_KEY_TYPE_MERGING_GROUPS, - XKB_WARNING_CONFLICTING_KEY_TYPE_PRESERVE_ENTRIES, XKB_WARNING_CONFLICTING_MODMAP, - XKB_WARNING_DEPRECATED_KEYSYM, XKB_WARNING_DEPRECATED_KEYSYM_NAME, XKB_WARNING_DUPLICATE_ENTRY, - XKB_WARNING_EXTRA_SYMBOLS_IGNORED, XKB_WARNING_ILLEGAL_KEYCODE_ALIAS, - XKB_WARNING_ILLEGAL_KEY_TYPE_PRESERVE_RESULT, XKB_WARNING_INVALID_ESCAPE_SEQUENCE, - XKB_WARNING_INVALID_UNICODE_ESCAPE_SEQUENCE, XKB_WARNING_MISSING_DEFAULT_SECTION, - XKB_WARNING_MISSING_SYMBOLS_GROUP_NAME_INDEX, XKB_WARNING_MULTIPLE_GROUPS_AT_ONCE, - XKB_WARNING_NON_BASE_GROUP_NAME, XKB_WARNING_NUMERIC_KEYSYM, - XKB_WARNING_UNDECLARED_MODIFIERS_IN_KEY_TYPE, XKB_WARNING_UNDEFINED_KEYCODE, - XKB_WARNING_UNDEFINED_KEY_TYPE, XKB_WARNING_UNKNOWN_CHAR_ESCAPE_SEQUENCE, - XKB_WARNING_UNRECOGNIZED_KEYSYM, XKB_WARNING_UNRESOLVED_KEYMAP_SYMBOL, - XKB_WARNING_UNSUPPORTED_GEOMETRY_SECTION, XKB_WARNING_UNSUPPORTED_LEGACY_ACTION, - XKB_WARNING_UNSUPPORTED_SYMBOLS_FIELD, _XKB_LOG_MESSAGE_MAX_CODE, _XKB_LOG_MESSAGE_MIN_CODE, -}; -pub use crate::scanner_utils::{scanner, scanner_loc, sval, svaleq, svaleq_prefix}; -pub use crate::shared_ast_types::{ - FILE_TYPE_COMPAT, FILE_TYPE_GEOMETRY, FILE_TYPE_INVALID, FILE_TYPE_KEYCODES, FILE_TYPE_KEYMAP, - FILE_TYPE_RULES, FILE_TYPE_SYMBOLS, FILE_TYPE_TYPES, FIRST_KEYMAP_FILE_TYPE, - LAST_KEYMAP_FILE_TYPE, _FILE_TYPE_NUM_ENTRIES, + XKB_ERROR_CANNOT_RESOLVE_RMLVO, XKB_ERROR_INVALID_FILE_ENCODING, XKB_ERROR_INVALID_RULES_SYNTAX, XKB_ERROR_RULES_INVALID_LAYOUT_INDEX_PERCENT_EXPANSION, }; +pub use crate::scanner_utils::{scanner, scanner_loc, sval, svaleq}; +pub use crate::shared_ast_types::FILE_TYPE_RULES; pub use crate::shared_types::XKB_MAX_GROUPS; -pub use crate::shared_types::{ - xkb_error_code, XKB_ERROR_ABI_BACKWARD_COMPAT, XKB_ERROR_ABI_FORWARD_COMPAT, - XKB_ERROR_ABI_INVALID_STRUCT_SIZE, XKB_ERROR_INVALID, XKB_ERROR_UNSUPPORTED_A11Y_FLAGS, - XKB_ERROR_UNSUPPORTED_LAYOUT_INDEX, XKB_ERROR_UNSUPPORTED_LAYOUT_OUT_OF_RANGE_POLICY, - XKB_ERROR_UNSUPPORTED_MODIFIER_MASK, XKB_SUCCESS, -}; -pub use crate::shared_types::{ - RMLVO, RMLVO_LAYOUT, RMLVO_MODEL, RMLVO_OPTIONS, RMLVO_RULES, RMLVO_VARIANT, -}; +pub use crate::shared_types::XKB_ERROR_UNSUPPORTED_LAYOUT_INDEX; pub use crate::xkbcomp::include::{ expand_path_str, FindFileInXkbPath, MERGE_AUGMENT_PREFIX, MERGE_OVERRIDE_PREFIX, diff --git a/xkb-core/src/xkbcomp/scanner.rs b/xkb-core/src/xkbcomp/scanner.rs index 5fc6b8e8..a1f5a535 100644 --- a/xkb-core/src/xkbcomp/scanner.rs +++ b/xkb-core/src/xkbcomp/scanner.rs @@ -87,78 +87,25 @@ pub mod utf8_h { } // Re-export parse functions from parser module -pub use super::parser::{parse, parse_next}; +pub use super::parser::parse; pub use crate::xkbcomp::keywords::keyword_to_token; pub use self::parser_h::{ - YYerror, ACTION_TOK, ALIAS, ALPHANUMERIC_KEYS, ALTERNATE, ALTERNATE_GROUP, AUGMENT, CBRACE, - CBRACKET, COMMA, CPAREN, DECIMAL_DIGIT, DEFAULT, DIVIDE, DOT, END_OF_FILE, EQUALS, ERROR_TOK, - EXCLAM, FLOAT, FUNCTION_KEYS, GROUP, HIDDEN, IDENT, INCLUDE, INDICATOR, INTEGER, INTERPRET, - INVERT, KEY, KEYNAME, KEYPAD_KEYS, KEYS, LOGO, MINUS, MODIFIER_KEYS, MODIFIER_MAP, OBRACE, - OBRACKET, OPAREN, OUTLINE, OVERLAY, OVERRIDE, PARTIAL, PLUS, REPLACE, ROW, SECTION, SEMI, - SHAPE, SOLID, STRING, TEXT, TIMES, TYPE, VIRTUAL, VIRTUAL_MODS, XKB_COMPATMAP, XKB_GEOMETRY, - XKB_KEYCODES, XKB_KEYMAP, XKB_LAYOUT, XKB_SEMANTICS, XKB_SYMBOLS, XKB_TYPES, YYEMPTY, YYUNDEF, + CBRACE, + CBRACKET, COMMA, CPAREN, DECIMAL_DIGIT, DIVIDE, DOT, END_OF_FILE, EQUALS, ERROR_TOK, + EXCLAM, FLOAT, IDENT, INTEGER, + INVERT, KEYNAME, MINUS, OBRACE, + OBRACKET, OPAREN, PLUS, SEMI, STRING, TIMES, }; pub use crate::messages::{ - XKB_ERROR_ABI_BACKWARD_COMPAT_, XKB_ERROR_ABI_FORWARD_COMPAT_, - XKB_ERROR_ABI_INVALID_STRUCT_SIZE_, XKB_ERROR_ALLOCATION_ERROR, XKB_ERROR_CANNOT_RESOLVE_RMLVO, - XKB_ERROR_CONFLICTING_KEY_SYMBOLS_ENTRY, XKB_ERROR_EXPECTED_ARRAY_ENTRY, - XKB_ERROR_GLOBAL_DEFAULTS_WRONG_SCOPE, XKB_ERROR_INCLUDED_FILE_NOT_FOUND, - XKB_ERROR_INCOMPATIBLE_ACTIONS_AND_KEYSYMS_COUNT, XKB_ERROR_INCOMPATIBLE_KEYMAP_TEXT_FORMAT, - XKB_ERROR_INSUFFICIENT_BUFFER_SIZE, XKB_ERROR_INTEGER_OVERFLOW, XKB_ERROR_INVALID_ACTION_FIELD, - XKB_ERROR_INVALID_COMPOSE_LOCALE, XKB_ERROR_INVALID_COMPOSE_SYNTAX, - XKB_ERROR_INVALID_EXPRESSION_TYPE, XKB_ERROR_INVALID_FILE_ENCODING, - XKB_ERROR_INVALID_IDENTIFIER, XKB_ERROR_INVALID_INCLUDED_FILE, - XKB_ERROR_INVALID_INCLUDE_STATEMENT, XKB_ERROR_INVALID_MODMAP_ENTRY, - XKB_ERROR_INVALID_NUMERIC_KEYSYM, XKB_ERROR_INVALID_OPERATION, XKB_ERROR_INVALID_PATH, - XKB_ERROR_INVALID_REAL_MODIFIER, XKB_ERROR_INVALID_RULES_SYNTAX, - XKB_ERROR_INVALID_SET_DEFAULT_STATEMENT, XKB_ERROR_INVALID_VALUE, XKB_ERROR_INVALID_XKB_SYNTAX, - XKB_ERROR_KEYMAP_COMPILATION_FAILED, XKB_ERROR_MALFORMED_NUMBER_LITERAL, - XKB_ERROR_NO_VALID_DEFAULT_INCLUDE_PATH, XKB_ERROR_OVERLAPPING_OVERLAY, - XKB_ERROR_RECURSIVE_INCLUDE, XKB_ERROR_RULES_INVALID_LAYOUT_INDEX_PERCENT_EXPANSION, - XKB_ERROR_UNDECLARED_VIRTUAL_MODIFIER, XKB_ERROR_UNKNOWN_ACTION_TYPE, - XKB_ERROR_UNKNOWN_DEFAULT_FIELD, XKB_ERROR_UNKNOWN_FIELD, XKB_ERROR_UNKNOWN_OPERATOR, - XKB_ERROR_UNKNOWN_STATEMENT, XKB_ERROR_UNSUPPORTED_A11Y_FLAGS_, - XKB_ERROR_UNSUPPORTED_LAYOUT_INDEX_, XKB_ERROR_UNSUPPORTED_LAYOUT_OUT_OF_RANGE_POLICY_, - XKB_ERROR_UNSUPPORTED_MODIFIER_MASK_, XKB_ERROR_UNSUPPORTED_OVERLAY_INDEX, - XKB_ERROR_UNSUPPORTED_SHIFT_LEVEL, XKB_ERROR_WRONG_FIELD_TYPE, XKB_ERROR_WRONG_STATEMENT_TYPE, - XKB_WARNING_CANNOT_INFER_KEY_TYPE, XKB_WARNING_CONFLICTING_KEY_ACTION, - XKB_WARNING_CONFLICTING_KEY_FIELDS, XKB_WARNING_CONFLICTING_KEY_NAME, - XKB_WARNING_CONFLICTING_KEY_SYMBOL, XKB_WARNING_CONFLICTING_KEY_TYPE_DEFINITIONS, - XKB_WARNING_CONFLICTING_KEY_TYPE_LEVEL_NAMES, XKB_WARNING_CONFLICTING_KEY_TYPE_MAP_ENTRY, - XKB_WARNING_CONFLICTING_KEY_TYPE_MERGING_GROUPS, - XKB_WARNING_CONFLICTING_KEY_TYPE_PRESERVE_ENTRIES, XKB_WARNING_CONFLICTING_MODMAP, - XKB_WARNING_DEPRECATED_KEYSYM, XKB_WARNING_DEPRECATED_KEYSYM_NAME, XKB_WARNING_DUPLICATE_ENTRY, - XKB_WARNING_EXTRA_SYMBOLS_IGNORED, XKB_WARNING_ILLEGAL_KEYCODE_ALIAS, - XKB_WARNING_ILLEGAL_KEY_TYPE_PRESERVE_RESULT, XKB_WARNING_INVALID_ESCAPE_SEQUENCE, - XKB_WARNING_INVALID_UNICODE_ESCAPE_SEQUENCE, XKB_WARNING_MISSING_DEFAULT_SECTION, - XKB_WARNING_MISSING_SYMBOLS_GROUP_NAME_INDEX, XKB_WARNING_MULTIPLE_GROUPS_AT_ONCE, - XKB_WARNING_NON_BASE_GROUP_NAME, XKB_WARNING_NUMERIC_KEYSYM, - XKB_WARNING_UNDECLARED_MODIFIERS_IN_KEY_TYPE, XKB_WARNING_UNDEFINED_KEYCODE, - XKB_WARNING_UNDEFINED_KEY_TYPE, XKB_WARNING_UNKNOWN_CHAR_ESCAPE_SEQUENCE, - XKB_WARNING_UNRECOGNIZED_KEYSYM, XKB_WARNING_UNRESOLVED_KEYMAP_SYMBOL, - XKB_WARNING_UNSUPPORTED_GEOMETRY_SECTION, XKB_WARNING_UNSUPPORTED_LEGACY_ACTION, - XKB_WARNING_UNSUPPORTED_SYMBOLS_FIELD, _XKB_LOG_MESSAGE_MAX_CODE, _XKB_LOG_MESSAGE_MIN_CODE, + XKB_ERROR_INVALID_FILE_ENCODING, XKB_ERROR_MALFORMED_NUMBER_LITERAL, XKB_WARNING_INVALID_ESCAPE_SEQUENCE, + XKB_WARNING_INVALID_UNICODE_ESCAPE_SEQUENCE, XKB_WARNING_UNKNOWN_CHAR_ESCAPE_SEQUENCE, }; -pub use crate::scanner_utils::{scanner, scanner_loc, sval}; +pub use crate::scanner_utils::{scanner, sval}; pub use crate::shared_ast_types::{ - ExprDef, ExprKind, GroupCompatDef, InterpDef, KeyAliasDef, KeyTypeDef, KeycodeDef, LedMapDef, - LedNameDef, ModMapDef, Statement, SymbolsDef, UnknownStatement, VModDef, VarDef, XkbFile, - _IncludeStmt, merge_mode, stmt_type, xkb_map_flags, FILE_TYPE_COMPAT, FILE_TYPE_GEOMETRY, - FILE_TYPE_INVALID, FILE_TYPE_KEYCODES, FILE_TYPE_KEYMAP, FILE_TYPE_RULES, FILE_TYPE_SYMBOLS, - FILE_TYPE_TYPES, FIRST_KEYMAP_FILE_TYPE, LAST_KEYMAP_FILE_TYPE, MAP_HAS_ALPHANUMERIC, - MAP_HAS_FN, MAP_HAS_KEYPAD, MAP_HAS_MODIFIER, MAP_IS_ALTGR, MAP_IS_DEFAULT, MAP_IS_HIDDEN, - MAP_IS_PARTIAL, MERGE_AUGMENT, MERGE_DEFAULT, MERGE_OVERRIDE, MERGE_REPLACE, STMT_ALIAS, - STMT_EXPR_ACTION_DECL, STMT_EXPR_ACTION_LIST, STMT_EXPR_ADD, STMT_EXPR_ARRAY_REF, - STMT_EXPR_ASSIGN, STMT_EXPR_BOOLEAN_LITERAL, STMT_EXPR_DIVIDE, STMT_EXPR_EMPTY_LIST, - STMT_EXPR_FIELD_REF, STMT_EXPR_FLOAT_LITERAL, STMT_EXPR_IDENT, STMT_EXPR_INTEGER_LITERAL, - STMT_EXPR_INVERT, STMT_EXPR_KEYNAME_LITERAL, STMT_EXPR_KEYSYM_LIST, STMT_EXPR_KEYSYM_LITERAL, - STMT_EXPR_MULTIPLY, STMT_EXPR_NEGATE, STMT_EXPR_NOT, STMT_EXPR_STRING_LITERAL, - STMT_EXPR_SUBTRACT, STMT_EXPR_UNARY_PLUS, STMT_GROUP_COMPAT, STMT_INCLUDE, STMT_INTERP, - STMT_KEYCODE, STMT_LED_MAP, STMT_LED_NAME, STMT_MODMAP, STMT_SYMBOLS, STMT_TYPE, STMT_UNKNOWN, - STMT_UNKNOWN_COMPOUND, STMT_UNKNOWN_DECLARATION, STMT_VAR, STMT_VMOD, _FILE_TYPE_NUM_ENTRIES, - _MERGE_MODE_NUM_ENTRIES, _STMT_NUM_VALUES, + ExprDef, GroupCompatDef, InterpDef, KeyAliasDef, KeyTypeDef, KeycodeDef, LedMapDef, + LedNameDef, ModMapDef, Statement, SymbolsDef, UnknownStatement, VModDef, VarDef, XkbFile, merge_mode, xkb_map_flags, MERGE_DEFAULT, }; // ── YYValue: safe replacement for the YYSTYPE union ── diff --git a/xkb-core/src/xkbcomp/types.rs b/xkb-core/src/xkbcomp/types.rs index 57f9110e..668f1c6f 100644 --- a/xkb-core/src/xkbcomp/types.rs +++ b/xkb-core/src/xkbcomp/types.rs @@ -1,6 +1,6 @@ use super::prelude::*; -pub use crate::shared_ast_types::{KeyTypeDef, ReportShouldBeArray}; +pub use crate::shared_ast_types::ReportShouldBeArray; use crate::text::ModMaskText; use crate::xkbcomp::expr::ExprResolveLevel; pub struct KeyTypesInfo { diff --git a/xkb-core/src/xkbcomp/vmod.rs b/xkb-core/src/xkbcomp/vmod.rs index 7e8b8c55..30789534 100644 --- a/xkb-core/src/xkbcomp/vmod.rs +++ b/xkb-core/src/xkbcomp/vmod.rs @@ -1,18 +1,9 @@ use crate::context::xkb_atom_text; pub use crate::shared_ast_types::{ - merge_mode, stmt_type, ExprDef, ExprKind, VModDef, MERGE_AUGMENT, MERGE_DEFAULT, - MERGE_OVERRIDE, MERGE_REPLACE, STMT_ALIAS, STMT_EXPR_ACTION_DECL, STMT_EXPR_ACTION_LIST, - STMT_EXPR_ADD, STMT_EXPR_ARRAY_REF, STMT_EXPR_ASSIGN, STMT_EXPR_BOOLEAN_LITERAL, - STMT_EXPR_DIVIDE, STMT_EXPR_EMPTY_LIST, STMT_EXPR_FIELD_REF, STMT_EXPR_FLOAT_LITERAL, - STMT_EXPR_IDENT, STMT_EXPR_INTEGER_LITERAL, STMT_EXPR_INVERT, STMT_EXPR_KEYNAME_LITERAL, - STMT_EXPR_KEYSYM_LIST, STMT_EXPR_KEYSYM_LITERAL, STMT_EXPR_MULTIPLY, STMT_EXPR_NEGATE, - STMT_EXPR_NOT, STMT_EXPR_STRING_LITERAL, STMT_EXPR_SUBTRACT, STMT_EXPR_UNARY_PLUS, - STMT_GROUP_COMPAT, STMT_INCLUDE, STMT_INTERP, STMT_KEYCODE, STMT_LED_MAP, STMT_LED_NAME, - STMT_MODMAP, STMT_SYMBOLS, STMT_TYPE, STMT_UNKNOWN, STMT_UNKNOWN_COMPOUND, - STMT_UNKNOWN_DECLARATION, STMT_VAR, STMT_VMOD, _MERGE_MODE_NUM_ENTRIES, _STMT_NUM_VALUES, + merge_mode, VModDef, MERGE_AUGMENT, }; -pub use crate::shared_types::{xkb_mod, xkb_mod_set, MOD_BOTH, MOD_REAL, MOD_VIRT, XKB_MAX_MODS}; +pub use crate::shared_types::{xkb_mod_set, MOD_REAL, MOD_VIRT, XKB_MAX_MODS}; use crate::text::ModMaskText; use crate::xkbcomp::expr::ExprResolveModMask; pub fn InitVMods(info: &mut xkb_mod_set, mods: &xkb_mod_set, reset: bool) { diff --git a/xkb-core/src/xkbcomp/xkbcomp.rs b/xkb-core/src/xkbcomp/xkbcomp.rs index ff16cb32..abd11e80 100644 --- a/xkb-core/src/xkbcomp/xkbcomp.rs +++ b/xkb-core/src/xkbcomp/xkbcomp.rs @@ -9,94 +9,16 @@ pub fn xkb_components_from_rules_names( crate::xkbcomp::rules::xkb_components_from_rules_names(ctx, rmlvo, out, explicit_layouts) } -pub use crate::messages::{ - XKB_ERROR_ABI_BACKWARD_COMPAT_, XKB_ERROR_ABI_FORWARD_COMPAT_, - XKB_ERROR_ABI_INVALID_STRUCT_SIZE_, XKB_ERROR_ALLOCATION_ERROR, XKB_ERROR_CANNOT_RESOLVE_RMLVO, - XKB_ERROR_CONFLICTING_KEY_SYMBOLS_ENTRY, XKB_ERROR_EXPECTED_ARRAY_ENTRY, - XKB_ERROR_GLOBAL_DEFAULTS_WRONG_SCOPE, XKB_ERROR_INCLUDED_FILE_NOT_FOUND, - XKB_ERROR_INCOMPATIBLE_ACTIONS_AND_KEYSYMS_COUNT, XKB_ERROR_INCOMPATIBLE_KEYMAP_TEXT_FORMAT, - XKB_ERROR_INSUFFICIENT_BUFFER_SIZE, XKB_ERROR_INTEGER_OVERFLOW, XKB_ERROR_INVALID_ACTION_FIELD, - XKB_ERROR_INVALID_COMPOSE_LOCALE, XKB_ERROR_INVALID_COMPOSE_SYNTAX, - XKB_ERROR_INVALID_EXPRESSION_TYPE, XKB_ERROR_INVALID_FILE_ENCODING, - XKB_ERROR_INVALID_IDENTIFIER, XKB_ERROR_INVALID_INCLUDED_FILE, - XKB_ERROR_INVALID_INCLUDE_STATEMENT, XKB_ERROR_INVALID_MODMAP_ENTRY, - XKB_ERROR_INVALID_NUMERIC_KEYSYM, XKB_ERROR_INVALID_OPERATION, XKB_ERROR_INVALID_PATH, - XKB_ERROR_INVALID_REAL_MODIFIER, XKB_ERROR_INVALID_RULES_SYNTAX, - XKB_ERROR_INVALID_SET_DEFAULT_STATEMENT, XKB_ERROR_INVALID_VALUE, XKB_ERROR_INVALID_XKB_SYNTAX, - XKB_ERROR_KEYMAP_COMPILATION_FAILED, XKB_ERROR_MALFORMED_NUMBER_LITERAL, - XKB_ERROR_NO_VALID_DEFAULT_INCLUDE_PATH, XKB_ERROR_OVERLAPPING_OVERLAY, - XKB_ERROR_RECURSIVE_INCLUDE, XKB_ERROR_RULES_INVALID_LAYOUT_INDEX_PERCENT_EXPANSION, - XKB_ERROR_UNDECLARED_VIRTUAL_MODIFIER, XKB_ERROR_UNKNOWN_ACTION_TYPE, - XKB_ERROR_UNKNOWN_DEFAULT_FIELD, XKB_ERROR_UNKNOWN_FIELD, XKB_ERROR_UNKNOWN_OPERATOR, - XKB_ERROR_UNKNOWN_STATEMENT, XKB_ERROR_UNSUPPORTED_A11Y_FLAGS_, - XKB_ERROR_UNSUPPORTED_LAYOUT_INDEX_, XKB_ERROR_UNSUPPORTED_LAYOUT_OUT_OF_RANGE_POLICY_, - XKB_ERROR_UNSUPPORTED_MODIFIER_MASK_, XKB_ERROR_UNSUPPORTED_OVERLAY_INDEX, - XKB_ERROR_UNSUPPORTED_SHIFT_LEVEL, XKB_ERROR_WRONG_FIELD_TYPE, XKB_ERROR_WRONG_STATEMENT_TYPE, - XKB_WARNING_CANNOT_INFER_KEY_TYPE, XKB_WARNING_CONFLICTING_KEY_ACTION, - XKB_WARNING_CONFLICTING_KEY_FIELDS, XKB_WARNING_CONFLICTING_KEY_NAME, - XKB_WARNING_CONFLICTING_KEY_SYMBOL, XKB_WARNING_CONFLICTING_KEY_TYPE_DEFINITIONS, - XKB_WARNING_CONFLICTING_KEY_TYPE_LEVEL_NAMES, XKB_WARNING_CONFLICTING_KEY_TYPE_MAP_ENTRY, - XKB_WARNING_CONFLICTING_KEY_TYPE_MERGING_GROUPS, - XKB_WARNING_CONFLICTING_KEY_TYPE_PRESERVE_ENTRIES, XKB_WARNING_CONFLICTING_MODMAP, - XKB_WARNING_DEPRECATED_KEYSYM, XKB_WARNING_DEPRECATED_KEYSYM_NAME, XKB_WARNING_DUPLICATE_ENTRY, - XKB_WARNING_EXTRA_SYMBOLS_IGNORED, XKB_WARNING_ILLEGAL_KEYCODE_ALIAS, - XKB_WARNING_ILLEGAL_KEY_TYPE_PRESERVE_RESULT, XKB_WARNING_INVALID_ESCAPE_SEQUENCE, - XKB_WARNING_INVALID_UNICODE_ESCAPE_SEQUENCE, XKB_WARNING_MISSING_DEFAULT_SECTION, - XKB_WARNING_MISSING_SYMBOLS_GROUP_NAME_INDEX, XKB_WARNING_MULTIPLE_GROUPS_AT_ONCE, - XKB_WARNING_NON_BASE_GROUP_NAME, XKB_WARNING_NUMERIC_KEYSYM, - XKB_WARNING_UNDECLARED_MODIFIERS_IN_KEY_TYPE, XKB_WARNING_UNDEFINED_KEYCODE, - XKB_WARNING_UNDEFINED_KEY_TYPE, XKB_WARNING_UNKNOWN_CHAR_ESCAPE_SEQUENCE, - XKB_WARNING_UNRECOGNIZED_KEYSYM, XKB_WARNING_UNRESOLVED_KEYMAP_SYMBOL, - XKB_WARNING_UNSUPPORTED_GEOMETRY_SECTION, XKB_WARNING_UNSUPPORTED_LEGACY_ACTION, - XKB_WARNING_UNSUPPORTED_SYMBOLS_FIELD, _XKB_LOG_MESSAGE_MAX_CODE, _XKB_LOG_MESSAGE_MIN_CODE, -}; +pub use crate::messages::XKB_ERROR_KEYMAP_COMPILATION_FAILED; pub use crate::shared_ast_types::{ - stmt_type, xkb_file_type_to_string, xkb_map_flags, XkbFile, FILE_TYPE_COMPAT, - FILE_TYPE_GEOMETRY, FILE_TYPE_INVALID, FILE_TYPE_KEYCODES, FILE_TYPE_KEYMAP, FILE_TYPE_RULES, - FILE_TYPE_SYMBOLS, FILE_TYPE_TYPES, FIRST_KEYMAP_FILE_TYPE, LAST_KEYMAP_FILE_TYPE, - MAP_HAS_ALPHANUMERIC, MAP_HAS_FN, MAP_HAS_KEYPAD, MAP_HAS_MODIFIER, MAP_IS_ALTGR, - MAP_IS_DEFAULT, MAP_IS_HIDDEN, MAP_IS_PARTIAL, STMT_ALIAS, STMT_EXPR_ACTION_DECL, - STMT_EXPR_ACTION_LIST, STMT_EXPR_ADD, STMT_EXPR_ARRAY_REF, STMT_EXPR_ASSIGN, - STMT_EXPR_BOOLEAN_LITERAL, STMT_EXPR_DIVIDE, STMT_EXPR_EMPTY_LIST, STMT_EXPR_FIELD_REF, - STMT_EXPR_FLOAT_LITERAL, STMT_EXPR_IDENT, STMT_EXPR_INTEGER_LITERAL, STMT_EXPR_INVERT, - STMT_EXPR_KEYNAME_LITERAL, STMT_EXPR_KEYSYM_LIST, STMT_EXPR_KEYSYM_LITERAL, STMT_EXPR_MULTIPLY, - STMT_EXPR_NEGATE, STMT_EXPR_NOT, STMT_EXPR_STRING_LITERAL, STMT_EXPR_SUBTRACT, - STMT_EXPR_UNARY_PLUS, STMT_GROUP_COMPAT, STMT_INCLUDE, STMT_INTERP, STMT_KEYCODE, STMT_LED_MAP, - STMT_LED_NAME, STMT_MODMAP, STMT_SYMBOLS, STMT_TYPE, STMT_UNKNOWN, STMT_UNKNOWN_COMPOUND, - STMT_UNKNOWN_DECLARATION, STMT_VAR, STMT_VMOD, _FILE_TYPE_NUM_ENTRIES, _STMT_NUM_VALUES, -}; -pub use crate::shared_types::{ - RMLVO, RMLVO_LAYOUT, RMLVO_MODEL, RMLVO_OPTIONS, RMLVO_RULES, RMLVO_VARIANT, + xkb_file_type_to_string, XkbFile, FILE_TYPE_KEYMAP, }; use crate::xkbcomp::ast_build::XkbFileFromComponents; use crate::xkbcomp::keymap::CompileKeymap; use crate::xkbcomp::scanner::XkbParseString; pub use crate::shared_types::{ - format_max_groups, xkb_action, xkb_action_controls, xkb_action_flags, xkb_controls_action, - xkb_explicit_components, xkb_group, xkb_group_action, xkb_internal_action, xkb_key, - xkb_key_alias, xkb_key_type, xkb_key_type_entry, xkb_keymap, xkb_keymap_serialize_flags, - xkb_keysym_count_t, xkb_led, xkb_level, xkb_mod, xkb_mod_action, xkb_mod_set, xkb_mods, - xkb_overlay_mask_t, xkb_pointer_action, xkb_pointer_button_action, xkb_pointer_default_action, - xkb_private_action, xkb_redirect_key_action, xkb_switch_screen_action, xkb_sym_interpret, - KeycodeMatch, ACTION_ABSOLUTE_SWITCH, ACTION_ABSOLUTE_X, ACTION_ABSOLUTE_Y, ACTION_ACCEL, - ACTION_LATCH_ON_PRESS, ACTION_LATCH_TO_LOCK, ACTION_LOCK_CLEAR, ACTION_LOCK_NO_LOCK, - ACTION_LOCK_NO_UNLOCK, ACTION_LOCK_ON_RELEASE, ACTION_MODS_LOOKUP_MODMAP, - ACTION_PENDING_COMPUTATION, ACTION_SAME_SCREEN, ACTION_TYPE_CTRL_LOCK, ACTION_TYPE_CTRL_SET, - ACTION_TYPE_GROUP_LATCH, ACTION_TYPE_GROUP_LOCK, ACTION_TYPE_GROUP_SET, ACTION_TYPE_INTERNAL, - ACTION_TYPE_MOD_LATCH, ACTION_TYPE_MOD_LOCK, ACTION_TYPE_MOD_SET, ACTION_TYPE_NONE, - ACTION_TYPE_PRIVATE, ACTION_TYPE_PTR_BUTTON, ACTION_TYPE_PTR_DEFAULT, ACTION_TYPE_PTR_LOCK, - ACTION_TYPE_PTR_MOVE, ACTION_TYPE_REDIRECT_KEY, ACTION_TYPE_SWITCH_VT, ACTION_TYPE_TERMINATE, - ACTION_TYPE_UNKNOWN, ACTION_TYPE_UNSUPPORTED_LEGACY, ACTION_TYPE_VOID, ACTION_UNLOCK_ON_PRESS, - CONTROL_ALL, CONTROL_ALL_BOOLEAN, CONTROL_ALL_BOOLEAN_V1, CONTROL_ALL_V1, CONTROL_AX, - CONTROL_AX_FEEDBACK, CONTROL_AX_TIMEOUT, CONTROL_BELL, CONTROL_DEBOUNCE, CONTROL_GROUPS_WRAP, - CONTROL_IGNORE_GROUP_LOCK, CONTROL_MOUSE_KEYS, CONTROL_MOUSE_KEYS_ACCEL, CONTROL_OVERLAY1, - CONTROL_OVERLAY2, CONTROL_OVERLAY3, CONTROL_OVERLAY4, CONTROL_OVERLAY5, CONTROL_OVERLAY6, - CONTROL_OVERLAY7, CONTROL_OVERLAY8, CONTROL_REPEAT, CONTROL_SLOW, CONTROL_STICKY_KEYS, - EXPLICIT_INTERP, EXPLICIT_OVERLAY, EXPLICIT_REPEAT, EXPLICIT_SYMBOLS, EXPLICIT_TYPES, - EXPLICIT_VMODMAP, INTERNAL_BREAKS_GROUP_LATCH, INTERNAL_BREAKS_MOD_LATCH, MATCH_ALL, MATCH_ANY, - MATCH_ANY_OR_NONE, MATCH_EXACTLY, MATCH_NONE, MOD_BOTH, MOD_REAL, MOD_VIRT, XKB_MAX_GROUPS, - XKB_MAX_GROUPS_X11, _ACTION_TYPE_NUM_ENTRIES, + format_max_groups, xkb_keymap, }; fn compile_keymap_file(keymap: &mut xkb_keymap, file: &mut XkbFile) -> bool { From 3ec5b45d904086f0eebe277b391dafe354214f0c Mon Sep 17 00:00:00 2001 From: Eivind Gamst Date: Fri, 24 Apr 2026 21:17:53 +0200 Subject: [PATCH 3/5] Add test files --- .gitignore | 1 + test_files/compile-include/LICENSE | 215 ++ .../compile-include/keycodes/merge_modes | 160 ++ .../compile-include/rules/all_qualifier | 59 + test_files/compile-include/rules/evdev-modern | 715 +++++++ .../compile-include/rules/extended-wild-cards | 23 + .../compile-include/rules/special_indexes | 58 + test_files/compile-include/rules/wildcard | 32 + test_files/compile-include/rules/x | 2 + .../compile-include/symbols/merge_modes | 902 +++++++++ test_files/compile-tests/.gitattributes | 1 + test_files/compile-tests/.gitignore | 3 + .../compile-tests/t00/t000/t0001/expected.xkb | 21 + .../compile-tests/t00/t000/t0001/input.xkb | 2 + .../compile-tests/t00/t000/t0002/expected.xkb | 34 + .../compile-tests/t00/t000/t0002/input.xkb | 27 + .../t00/t000/t0002/keycodes/a.xkb | 3 + .../t00/t000/t0002/keycodes/b.xkb | 3 + .../compile-tests/t00/t000/t0003/expected.xkb | 28 + .../compile-tests/t00/t000/t0003/input.xkb | 12 + .../compile-tests/t00/t000/t0004/compat/a.xkb | 3 + .../compile-tests/t00/t000/t0004/compat/b.xkb | 12 + .../compile-tests/t00/t000/t0004/expected.xkb | 27 + .../compile-tests/t00/t000/t0004/input.xkb | 5 + .../compile-tests/t00/t000/t0006/expected.xkb | 22 + .../compile-tests/t00/t000/t0006/input.xkb | 9 + .../compile-tests/t00/t000/t0007/expected.xkb | 21 + .../compile-tests/t00/t000/t0007/input.xkb | 5 + .../compile-tests/t00/t001/t0018/expected.xkb | 35 + .../compile-tests/t00/t001/t0018/input.xkb | 8 + .../compile-tests/t00/t001/t0019/expected.xkb | 37 + .../compile-tests/t00/t001/t0019/input.xkb | 9 + .../compile-tests/t00/t002/t0020/expected.xkb | 40 + .../compile-tests/t00/t002/t0020/input.xkb | 10 + .../compile-tests/t00/t002/t0021/expected.xkb | 37 + .../compile-tests/t00/t002/t0021/input.xkb | 13 + .../compile-tests/t00/t002/t0022/expected.xkb | 37 + .../compile-tests/t00/t002/t0022/input.xkb | 16 + .../compile-tests/t00/t002/t0023/expected.xkb | 39 + .../compile-tests/t00/t002/t0023/input.xkb | 17 + .../compile-tests/t00/t002/t0024/expected.xkb | 39 + .../compile-tests/t00/t002/t0024/input.xkb | 17 + .../compile-tests/t00/t002/t0025/expected.xkb | 39 + .../compile-tests/t00/t002/t0025/input.xkb | 17 + .../compile-tests/t00/t002/t0026/expected.xkb | 39 + .../compile-tests/t00/t002/t0026/input.xkb | 17 + .../compile-tests/t00/t002/t0027/expected.xkb | 39 + .../compile-tests/t00/t002/t0027/input.xkb | 17 + .../compile-tests/t00/t002/t0028/expected.xkb | 37 + .../compile-tests/t00/t002/t0028/input.xkb | 16 + .../compile-tests/t00/t003/t0030/expected.xkb | 48 + .../compile-tests/t00/t003/t0030/input.xkb | 16 + .../compile-tests/t00/t003/t0031/expected.xkb | 33 + .../compile-tests/t00/t003/t0031/input.xkb | 16 + .../compile-tests/t00/t005/t0051/expected.xkb | 35 + .../compile-tests/t00/t005/t0051/input.xkb | 20 + .../compile-tests/t00/t005/t0052/expected.xkb | 35 + .../compile-tests/t00/t005/t0052/input.xkb | 22 + .../compile-tests/t00/t005/t0055/expected.xkb | 25 + .../compile-tests/t00/t005/t0055/input.xkb | 9 + .../compile-tests/t00/t006/t0061/expected.xkb | 21 + .../compile-tests/t00/t006/t0061/input.xkb | 10 + .../compile-tests/t00/t006/t0062/expected.xkb | 28 + .../compile-tests/t00/t006/t0062/input.xkb | 10 + .../compile-tests/t00/t006/t0063/expected.xkb | 32 + .../compile-tests/t00/t006/t0063/input.xkb | 13 + .../compile-tests/t00/t006/t0064/expected.xkb | 21 + .../compile-tests/t00/t006/t0064/input.xkb | 6 + .../compile-tests/t00/t006/t0065/expected.xkb | 22 + .../compile-tests/t00/t006/t0065/input.xkb | 5 + .../t00/t006/t0065/keycodes/x.xkb | 4 + .../compile-tests/t00/t006/t0066/expected.xkb | 32 + .../compile-tests/t00/t006/t0066/input.xkb | 9 + .../t00/t006/t0066/keycodes/x.xkb | 4 + .../compile-tests/t00/t007/t0074/expected.xkb | 35 + .../compile-tests/t00/t007/t0074/input.xkb | 12 + .../compile-tests/t00/t007/t0075/expected.xkb | 36 + .../compile-tests/t00/t007/t0075/input.xkb | 14 + .../compile-tests/t00/t007/t0076/expected.xkb | 35 + .../compile-tests/t00/t007/t0076/input.xkb | 15 + .../compile-tests/t00/t007/t0077/expected.xkb | 39 + .../compile-tests/t00/t007/t0077/input.xkb | 17 + .../compile-tests/t00/t007/t0078/expected.xkb | 26 + .../compile-tests/t00/t007/t0078/input.xkb | 8 + .../compile-tests/t00/t007/t0079/expected.xkb | 39 + .../compile-tests/t00/t007/t0079/input.xkb | 17 + .../compile-tests/t00/t008/t0080/expected.xkb | 25 + .../compile-tests/t00/t008/t0080/input.xkb | 6 + .../compile-tests/t00/t008/t0081/expected.xkb | 37 + .../compile-tests/t00/t008/t0081/input.xkb | 18 + .../compile-tests/t00/t008/t0082/expected.xkb | 37 + .../compile-tests/t00/t008/t0082/input.xkb | 18 + .../compile-tests/t00/t008/t0083/expected.xkb | 40 + .../compile-tests/t00/t008/t0083/input.xkb | 20 + .../compile-tests/t00/t008/t0084/expected.xkb | 37 + .../compile-tests/t00/t008/t0084/input.xkb | 17 + .../compile-tests/t00/t008/t0085/expected.xkb | 38 + .../compile-tests/t00/t008/t0085/input.xkb | 20 + .../compile-tests/t00/t008/t0086/expected.xkb | 35 + .../compile-tests/t00/t008/t0086/input.xkb | 17 + .../compile-tests/t00/t008/t0087/expected.xkb | 39 + .../compile-tests/t00/t008/t0087/input.xkb | 19 + .../compile-tests/t00/t008/t0088/expected.xkb | 25 + .../compile-tests/t00/t008/t0088/input.xkb | 10 + .../compile-tests/t00/t008/t0089/expected.xkb | 26 + .../compile-tests/t00/t008/t0089/input.xkb | 10 + .../compile-tests/t00/t009/t0090/expected.xkb | 26 + .../compile-tests/t00/t009/t0090/input.xkb | 10 + .../compile-tests/t00/t009/t0091/expected.xkb | 27 + .../compile-tests/t00/t009/t0091/input.xkb | 11 + .../compile-tests/t00/t009/t0093/compat/x.xkb | 6 + .../compile-tests/t00/t009/t0093/expected.xkb | 22 + .../compile-tests/t00/t009/t0093/input.xkb | 5 + .../compile-tests/t00/t009/t0094/expected.xkb | 21 + .../compile-tests/t00/t009/t0094/input.xkb | 6 + .../compile-tests/t00/t009/t0095/expected.xkb | 21 + .../compile-tests/t00/t009/t0095/input.xkb | 2 + .../compile-tests/t00/t009/t0096/expected.xkb | 21 + .../compile-tests/t00/t009/t0096/input.xkb | 5 + .../compile-tests/t00/t009/t0099/expected.xkb | 22 + .../compile-tests/t00/t009/t0099/input.xkb | 5 + .../compile-tests/t01/t010/t0102/expected.xkb | 28 + .../compile-tests/t01/t010/t0102/input.xkb | 8 + .../t01/t010/t0102/symbols/x.xkb | 3 + .../compile-tests/t01/t010/t0105/expected.xkb | 30 + .../compile-tests/t01/t010/t0105/input.xkb | 12 + .../compile-tests/t01/t011/t0110/expected.xkb | 30 + .../compile-tests/t01/t011/t0110/input.xkb | 10 + .../compile-tests/t01/t011/t0111/expected.xkb | 30 + .../compile-tests/t01/t011/t0111/input.xkb | 10 + .../compile-tests/t01/t011/t0112/expected.xkb | 30 + .../compile-tests/t01/t011/t0112/input.xkb | 9 + .../compile-tests/t01/t011/t0113/expected.xkb | 35 + .../compile-tests/t01/t011/t0113/input.xkb | 9 + .../compile-tests/t01/t011/t0114/expected.xkb | 35 + .../compile-tests/t01/t011/t0114/input.xkb | 9 + .../compile-tests/t01/t011/t0115/expected.xkb | 35 + .../compile-tests/t01/t011/t0115/input.xkb | 9 + .../compile-tests/t01/t011/t0116/expected.xkb | 35 + .../compile-tests/t01/t011/t0116/input.xkb | 9 + .../compile-tests/t01/t011/t0119/expected.xkb | 37 + .../compile-tests/t01/t011/t0119/input.xkb | 15 + .../compile-tests/t01/t012/t0120/expected.xkb | 35 + .../compile-tests/t01/t012/t0120/input.xkb | 11 + .../compile-tests/t01/t012/t0126/expected.xkb | 22 + .../compile-tests/t01/t012/t0126/input.xkb | 8 + .../compile-tests/t01/t012/t0127/expected.xkb | 22 + .../compile-tests/t01/t012/t0127/input.xkb | 9 + .../compile-tests/t01/t012/t0128/expected.xkb | 32 + .../compile-tests/t01/t012/t0128/input.xkb | 9 + .../t01/t012/t0128/symbols/x.xkb | 4 + .../compile-tests/t01/t012/t0129/expected.xkb | 35 + .../compile-tests/t01/t012/t0129/input.xkb | 12 + .../t01/t012/t0129/symbols/x.xkb | 3 + .../compile-tests/t01/t013/t0130/expected.xkb | 23 + .../compile-tests/t01/t013/t0130/input.xkb | 5 + .../t01/t013/t0130/symbols/x.xkb | 4 + .../compile-tests/t01/t013/t0135/expected.xkb | 36 + .../compile-tests/t01/t013/t0135/input.xkb | 11 + .../compile-tests/t01/t013/t0137/expected.xkb | 35 + .../compile-tests/t01/t013/t0137/input.xkb | 17 + .../compile-tests/t01/t013/t0138/expected.xkb | 21 + .../compile-tests/t01/t013/t0138/input.xkb | 8 + .../compile-tests/t01/t015/t0153/expected.xkb | 35 + .../compile-tests/t01/t015/t0153/input.xkb | 16 + .../compile-tests/t02/t025/t0252/expected.xkb | 35 + .../compile-tests/t02/t025/t0252/input.xkb | 8 + .../t02/t025/t0252/keycodes/a.xkb | 7 + .../compile-tests/t02/t025/t0253/expected.xkb | 35 + .../compile-tests/t02/t025/t0253/input.xkb | 8 + .../t02/t025/t0253/keycodes/a.xkb | 3 + .../compile-tests/t02/t025/t0254/compat/a.xkb | 3 + .../compile-tests/t02/t025/t0254/expected.xkb | 21 + .../compile-tests/t02/t025/t0254/input.xkb | 5 + .../compile-tests/t02/t025/t0255/compat/a.xkb | 3 + .../compile-tests/t02/t025/t0255/expected.xkb | 21 + .../compile-tests/t02/t025/t0255/input.xkb | 5 + .../compile-tests/t02/t025/t0256/expected.xkb | 21 + .../compile-tests/t02/t025/t0256/input.xkb | 1 + .../compile-tests/t02/t025/t0257/expected.xkb | 21 + .../compile-tests/t02/t025/t0257/input.xkb | 1 + .../compile-tests/t02/t025/t0258/expected.xkb | 21 + .../compile-tests/t02/t025/t0258/input.xkb | 5 + .../compile-tests/t02/t025/t0259/expected.xkb | 35 + .../compile-tests/t02/t025/t0259/input.xkb | 8 + .../t02/t025/t0259/keycodes/a.xkb | 3 + .../compile-tests/t02/t026/t0262/expected.xkb | 21 + .../compile-tests/t02/t026/t0262/input.xkb | 5 + .../compile-tests/t02/t026/t0266/expected.xkb | 21 + .../compile-tests/t02/t026/t0266/input.xkb | 6 + .../compile-tests/t02/t026/t0268/expected.xkb | 22 + .../compile-tests/t02/t026/t0268/input.xkb | 5 + .../compile-tests/t02/t026/t0269/expected.xkb | 22 + .../compile-tests/t02/t026/t0269/input.xkb | 5 + .../compile-tests/t02/t027/t0274/expected.xkb | 22 + .../t027/t0274/extra-includes/keycodes/x.xkb | 3 + .../compile-tests/t02/t027/t0274/input.xkb | 6 + .../t02/t027/t0274/keycodes/x.xkb | 3 + .../compile-tests/t02/t027/t0275/expected.xkb | 21 + .../t027/t0275/extra-includes/keycodes/x.xkb | 3 + .../compile-tests/t02/t027/t0275/input.xkb | 5 + .../t02/t027/t0275/keycodes/x.xkb | 3 + .../compile-tests/t02/t027/t0276/expected.xkb | 21 + .../compile-tests/t02/t027/t0276/input.xkb | 7 + .../t02/t027/t0276/keycodes/x.xkb | 3 + .../compile-tests/t02/t027/t0278/expected.xkb | 21 + .../compile-tests/t02/t027/t0278/input.xkb | 7 + .../t02/t027/t0278/keycodes/x.xkb | 3 + .../compile-tests/t02/t028/t0282/expected.xkb | 21 + .../compile-tests/t02/t028/t0282/input.xkb | 7 + .../t02/t028/t0282/keycodes/x.xkb | 6 + .../compile-tests/t02/t028/t0283/expected.xkb | 21 + .../compile-tests/t02/t028/t0283/input.xkb | 6 + .../t02/t028/t0283/keycodes/x.xkb | 7 + .../compile-tests/t02/t028/t0284/expected.xkb | 21 + .../compile-tests/t02/t028/t0284/input.xkb | 6 + .../t02/t028/t0284/keycodes/x.xkb | 7 + .../compile-tests/t02/t028/t0285/expected.xkb | 21 + .../compile-tests/t02/t028/t0285/input.xkb | 5 + .../compile-tests/t02/t028/t0287/expected.xkb | 21 + .../compile-tests/t02/t028/t0287/input.xkb | 5 + .../t02/t028/t0287/keycodes/x.xkb | 3 + .../t02/t028/t0287/keycodes/y.xkb | 3 + .../compile-tests/t02/t028/t0288/expected.xkb | 21 + .../compile-tests/t02/t028/t0288/input.xkb | 8 + .../compile-tests/t02/t028/t0289/expected.xkb | 21 + .../compile-tests/t02/t028/t0289/input.xkb | 8 + .../compile-tests/t02/t029/t0290/expected.xkb | 25 + .../compile-tests/t02/t029/t0290/input.xkb | 7 + .../compile-tests/t02/t029/t0291/expected.xkb | 25 + .../compile-tests/t02/t029/t0291/input.xkb | 7 + .../compile-tests/t02/t029/t0292/expected.xkb | 26 + .../compile-tests/t02/t029/t0292/input.xkb | 8 + .../compile-tests/t02/t029/t0296/expected.xkb | 25 + .../compile-tests/t02/t029/t0296/input.xkb | 7 + .../compile-tests/t03/t031/t0310/expected.xkb | 37 + .../compile-tests/t03/t031/t0310/input.xkb | 16 + .../compile-tests/t03/t031/t0311/expected.xkb | 37 + .../compile-tests/t03/t031/t0311/input.xkb | 13 + .../compile-tests/t03/t031/t0312/expected.xkb | 37 + .../compile-tests/t03/t031/t0312/input.xkb | 13 + .../compile-tests/t03/t033/t0337/expected.xkb | 38 + .../compile-tests/t03/t033/t0337/input.xkb | 16 + .../compile-tests/t03/t033/t0339/expected.xkb | 38 + .../compile-tests/t03/t033/t0339/input.xkb | 16 + .../compile-tests/t03/t034/t0340/expected.xkb | 38 + .../compile-tests/t03/t034/t0340/input.xkb | 16 + .../compile-tests/t03/t034/t0341/expected.xkb | 39 + .../compile-tests/t03/t034/t0341/input.xkb | 17 + .../compile-tests/t03/t034/t0342/expected.xkb | 39 + .../compile-tests/t03/t034/t0342/input.xkb | 17 + .../compile-tests/t03/t034/t0345/expected.xkb | 39 + .../compile-tests/t03/t034/t0345/input.xkb | 15 + .../compile-tests/t03/t034/t0348/expected.xkb | 21 + .../compile-tests/t03/t034/t0348/input.xkb | 5 + .../compile-tests/t03/t034/t0349/expected.xkb | 37 + .../compile-tests/t03/t034/t0349/input.xkb | 12 + .../compile-tests/t03/t035/t0359/expected.xkb | 46 + .../compile-tests/t03/t035/t0359/input.xkb | 20 + .../compile-tests/t03/t036/t0361/expected.xkb | 39 + .../compile-tests/t03/t036/t0361/input.xkb | 17 + .../compile-tests/t03/t036/t0367/expected.xkb | 82 + .../compile-tests/t03/t036/t0367/input.xkb | 47 + .../compile-tests/t03/t037/t0370/expected.xkb | 40 + .../compile-tests/t03/t037/t0370/input.xkb | 10 + .../t03/t037/t0370/symbols/a.xkb | 12 + .../compile-tests/t03/t038/t0384/expected.xkb | 35 + .../compile-tests/t03/t038/t0384/input.xkb | 11 + .../compile-tests/t03/t038/t0385/expected.xkb | 45 + .../compile-tests/t03/t038/t0385/input.xkb | 18 + .../compile-tests/t03/t039/t0390/expected.xkb | 38 + .../compile-tests/t03/t039/t0390/input.xkb | 22 + .../compile-tests/t03/t039/t0391/expected.xkb | 29 + .../compile-tests/t03/t039/t0391/input.xkb | 16 + .../compile-tests/t03/t039/t0392/expected.xkb | 35 + .../compile-tests/t03/t039/t0392/input.xkb | 13 + .../compile-tests/t03/t039/t0394/expected.xkb | 35 + .../compile-tests/t03/t039/t0394/input.xkb | 8 + .../t03/t039/t0394/symbols/a.xkb | 3 + .../compile-tests/t04/t041/t0411/expected.xkb | 37 + .../compile-tests/t04/t041/t0411/input.xkb | 9 + .../compile-tests/t04/t041/t0412/expected.xkb | 37 + .../compile-tests/t04/t041/t0412/input.xkb | 9 + .../compile-tests/t04/t041/t0413/expected.xkb | 38 + .../compile-tests/t04/t041/t0413/input.xkb | 12 + .../compile-tests/t04/t041/t0414/expected.xkb | 28 + .../compile-tests/t04/t041/t0414/input.xkb | 9 + .../compile-tests/t04/t041/t0415/expected.xkb | 37 + .../compile-tests/t04/t041/t0415/input.xkb | 10 + .../compile-tests/t04/t041/t0416/expected.xkb | 37 + .../compile-tests/t04/t041/t0416/input.xkb | 12 + .../compile-tests/t04/t042/t0421/expected.xkb | 36 + .../compile-tests/t04/t042/t0421/input.xkb | 8 + .../compile-tests/t04/t042/t0422/expected.xkb | 35 + .../compile-tests/t04/t042/t0422/input.xkb | 8 + .../compile-tests/t04/t042/t0423/expected.xkb | 35 + .../compile-tests/t04/t042/t0423/input.xkb | 8 + .../compile-tests/t04/t042/t0424/expected.xkb | 36 + .../compile-tests/t04/t042/t0424/input.xkb | 8 + .../compile-tests/t04/t042/t0425/expected.xkb | 29 + .../compile-tests/t04/t042/t0425/input.xkb | 9 + .../compile-tests/t04/t043/t0430/expected.xkb | 37 + .../compile-tests/t04/t043/t0430/input.xkb | 13 + .../compile-tests/t04/t043/t0431/expected.xkb | 36 + .../compile-tests/t04/t043/t0431/input.xkb | 13 + .../compile-tests/t04/t043/t0435/expected.xkb | 36 + .../compile-tests/t04/t043/t0435/input.xkb | 13 + .../compile-tests/t04/t043/t0437/expected.xkb | 37 + .../compile-tests/t04/t043/t0437/input.xkb | 13 + .../compile-tests/t04/t043/t0438/expected.xkb | 35 + .../compile-tests/t04/t043/t0438/input.xkb | 8 + .../compile-tests/t04/t043/t0439/expected.xkb | 66 + .../compile-tests/t04/t043/t0439/input.xkb | 18 + .../compile-tests/t04/t044/t0440/expected.xkb | 42 + .../compile-tests/t04/t044/t0440/input.xkb | 12 + .../compile-tests/t04/t044/t0443/expected.xkb | 45 + .../compile-tests/t04/t044/t0443/input.xkb | 20 + .../compile-tests/t04/t044/t0445/expected.xkb | 47 + .../compile-tests/t04/t044/t0445/input.xkb | 16 + .../compile-tests/t04/t044/t0449/expected.xkb | 38 + .../compile-tests/t04/t044/t0449/input.xkb | 10 + .../compile-tests/t04/t045/t0450/expected.xkb | 38 + .../compile-tests/t04/t045/t0450/input.xkb | 10 + .../compile-tests/t04/t045/t0451/expected.xkb | 39 + .../compile-tests/t04/t045/t0451/input.xkb | 10 + .../compile-tests/t04/t045/t0452/expected.xkb | 39 + .../compile-tests/t04/t045/t0452/input.xkb | 10 + .../compile-tests/t04/t046/t0460/expected.xkb | 21 + .../compile-tests/t04/t046/t0460/input.xkb | 6 + .../compile-tests/t04/t046/t0461/expected.xkb | 21 + .../compile-tests/t04/t046/t0461/input.xkb | 7 + .../compile-tests/t04/t046/t0462/expected.xkb | 22 + .../compile-tests/t04/t046/t0462/input.xkb | 11 + .../compile-tests/t04/t048/t0482/expected.xkb | 34 + .../compile-tests/t04/t048/t0482/input.xkb | 18 + .../compile-tests/t04/t048/t0483/expected.xkb | 21 + .../compile-tests/t04/t048/t0483/input.xkb | 1 + .../compile-tests/t04/t048/t0484/expected.xkb | 21 + .../compile-tests/t04/t048/t0484/input.xkb | 1 + .../compile-tests/t04/t048/t0485/expected.xkb | 185 ++ .../compile-tests/t04/t048/t0485/input.xkb | 66 + .../compile-tests/t04/t048/t0486/expected.xkb | 72 + .../compile-tests/t04/t048/t0486/input.xkb | 24 + .../compile-tests/t04/t049/t0492/expected.xkb | 34 + .../compile-tests/t04/t049/t0492/input.xkb | 16 + .../compile-tests/t04/t049/t0493/expected.xkb | 36 + .../compile-tests/t04/t049/t0493/input.xkb | 8 + .../compile-tests/t04/t049/t0494/expected.xkb | 49 + .../compile-tests/t04/t049/t0494/input.xkb | 21 + test_files/type-include/keycodes/generated | 518 +++++ test_files/type-tests/.gitattributes | 1 + test_files/type-tests/.gitignore | 1 + .../type-tests/t00/t003/t0038/expected.txt | 20 + .../type-tests/t00/t003/t0038/input.txt | 5 + test_files/type-tests/t00/t003/t0038/map.xkb | 12 + .../type-tests/t00/t005/t0056/expected.txt | 16 + .../type-tests/t00/t005/t0056/input.txt | 4 + test_files/type-tests/t00/t005/t0056/map.xkb | 1729 +++++++++++++++++ .../type-tests/t00/t006/t0061/expected.txt | 17 + .../type-tests/t00/t006/t0061/input.txt | 4 + test_files/type-tests/t00/t006/t0061/map.xkb | 1473 ++++++++++++++ .../type-tests/t00/t006/t0062/expected.txt | 16 + .../type-tests/t00/t006/t0062/input.txt | 4 + test_files/type-tests/t00/t006/t0062/map.xkb | 1533 +++++++++++++++ .../type-tests/t00/t009/t0095/expected.txt | 4 + .../type-tests/t00/t009/t0095/input.txt | 2 + test_files/type-tests/t00/t009/t0095/map.xkb | 8 + 367 files changed, 14574 insertions(+) create mode 100644 test_files/compile-include/LICENSE create mode 100644 test_files/compile-include/keycodes/merge_modes create mode 100644 test_files/compile-include/rules/all_qualifier create mode 100644 test_files/compile-include/rules/evdev-modern create mode 100644 test_files/compile-include/rules/extended-wild-cards create mode 100644 test_files/compile-include/rules/special_indexes create mode 100644 test_files/compile-include/rules/wildcard create mode 100644 test_files/compile-include/rules/x create mode 100644 test_files/compile-include/symbols/merge_modes create mode 100644 test_files/compile-tests/.gitattributes create mode 100644 test_files/compile-tests/.gitignore create mode 100644 test_files/compile-tests/t00/t000/t0001/expected.xkb create mode 100644 test_files/compile-tests/t00/t000/t0001/input.xkb create mode 100644 test_files/compile-tests/t00/t000/t0002/expected.xkb create mode 100644 test_files/compile-tests/t00/t000/t0002/input.xkb create mode 100644 test_files/compile-tests/t00/t000/t0002/keycodes/a.xkb create mode 100644 test_files/compile-tests/t00/t000/t0002/keycodes/b.xkb create mode 100644 test_files/compile-tests/t00/t000/t0003/expected.xkb create mode 100644 test_files/compile-tests/t00/t000/t0003/input.xkb create mode 100644 test_files/compile-tests/t00/t000/t0004/compat/a.xkb create mode 100644 test_files/compile-tests/t00/t000/t0004/compat/b.xkb create mode 100644 test_files/compile-tests/t00/t000/t0004/expected.xkb create mode 100644 test_files/compile-tests/t00/t000/t0004/input.xkb create mode 100644 test_files/compile-tests/t00/t000/t0006/expected.xkb create mode 100644 test_files/compile-tests/t00/t000/t0006/input.xkb create mode 100644 test_files/compile-tests/t00/t000/t0007/expected.xkb create mode 100644 test_files/compile-tests/t00/t000/t0007/input.xkb create mode 100644 test_files/compile-tests/t00/t001/t0018/expected.xkb create mode 100644 test_files/compile-tests/t00/t001/t0018/input.xkb create mode 100644 test_files/compile-tests/t00/t001/t0019/expected.xkb create mode 100644 test_files/compile-tests/t00/t001/t0019/input.xkb create mode 100644 test_files/compile-tests/t00/t002/t0020/expected.xkb create mode 100644 test_files/compile-tests/t00/t002/t0020/input.xkb create mode 100644 test_files/compile-tests/t00/t002/t0021/expected.xkb create mode 100644 test_files/compile-tests/t00/t002/t0021/input.xkb create mode 100644 test_files/compile-tests/t00/t002/t0022/expected.xkb create mode 100644 test_files/compile-tests/t00/t002/t0022/input.xkb create mode 100644 test_files/compile-tests/t00/t002/t0023/expected.xkb create mode 100644 test_files/compile-tests/t00/t002/t0023/input.xkb create mode 100644 test_files/compile-tests/t00/t002/t0024/expected.xkb create mode 100644 test_files/compile-tests/t00/t002/t0024/input.xkb create mode 100644 test_files/compile-tests/t00/t002/t0025/expected.xkb create mode 100644 test_files/compile-tests/t00/t002/t0025/input.xkb create mode 100644 test_files/compile-tests/t00/t002/t0026/expected.xkb create mode 100644 test_files/compile-tests/t00/t002/t0026/input.xkb create mode 100644 test_files/compile-tests/t00/t002/t0027/expected.xkb create mode 100644 test_files/compile-tests/t00/t002/t0027/input.xkb create mode 100644 test_files/compile-tests/t00/t002/t0028/expected.xkb create mode 100644 test_files/compile-tests/t00/t002/t0028/input.xkb create mode 100644 test_files/compile-tests/t00/t003/t0030/expected.xkb create mode 100644 test_files/compile-tests/t00/t003/t0030/input.xkb create mode 100644 test_files/compile-tests/t00/t003/t0031/expected.xkb create mode 100644 test_files/compile-tests/t00/t003/t0031/input.xkb create mode 100644 test_files/compile-tests/t00/t005/t0051/expected.xkb create mode 100644 test_files/compile-tests/t00/t005/t0051/input.xkb create mode 100644 test_files/compile-tests/t00/t005/t0052/expected.xkb create mode 100644 test_files/compile-tests/t00/t005/t0052/input.xkb create mode 100644 test_files/compile-tests/t00/t005/t0055/expected.xkb create mode 100644 test_files/compile-tests/t00/t005/t0055/input.xkb create mode 100644 test_files/compile-tests/t00/t006/t0061/expected.xkb create mode 100644 test_files/compile-tests/t00/t006/t0061/input.xkb create mode 100644 test_files/compile-tests/t00/t006/t0062/expected.xkb create mode 100644 test_files/compile-tests/t00/t006/t0062/input.xkb create mode 100644 test_files/compile-tests/t00/t006/t0063/expected.xkb create mode 100644 test_files/compile-tests/t00/t006/t0063/input.xkb create mode 100644 test_files/compile-tests/t00/t006/t0064/expected.xkb create mode 100644 test_files/compile-tests/t00/t006/t0064/input.xkb create mode 100644 test_files/compile-tests/t00/t006/t0065/expected.xkb create mode 100644 test_files/compile-tests/t00/t006/t0065/input.xkb create mode 100644 test_files/compile-tests/t00/t006/t0065/keycodes/x.xkb create mode 100644 test_files/compile-tests/t00/t006/t0066/expected.xkb create mode 100644 test_files/compile-tests/t00/t006/t0066/input.xkb create mode 100644 test_files/compile-tests/t00/t006/t0066/keycodes/x.xkb create mode 100644 test_files/compile-tests/t00/t007/t0074/expected.xkb create mode 100644 test_files/compile-tests/t00/t007/t0074/input.xkb create mode 100644 test_files/compile-tests/t00/t007/t0075/expected.xkb create mode 100644 test_files/compile-tests/t00/t007/t0075/input.xkb create mode 100644 test_files/compile-tests/t00/t007/t0076/expected.xkb create mode 100644 test_files/compile-tests/t00/t007/t0076/input.xkb create mode 100644 test_files/compile-tests/t00/t007/t0077/expected.xkb create mode 100644 test_files/compile-tests/t00/t007/t0077/input.xkb create mode 100644 test_files/compile-tests/t00/t007/t0078/expected.xkb create mode 100644 test_files/compile-tests/t00/t007/t0078/input.xkb create mode 100644 test_files/compile-tests/t00/t007/t0079/expected.xkb create mode 100644 test_files/compile-tests/t00/t007/t0079/input.xkb create mode 100644 test_files/compile-tests/t00/t008/t0080/expected.xkb create mode 100644 test_files/compile-tests/t00/t008/t0080/input.xkb create mode 100644 test_files/compile-tests/t00/t008/t0081/expected.xkb create mode 100644 test_files/compile-tests/t00/t008/t0081/input.xkb create mode 100644 test_files/compile-tests/t00/t008/t0082/expected.xkb create mode 100644 test_files/compile-tests/t00/t008/t0082/input.xkb create mode 100644 test_files/compile-tests/t00/t008/t0083/expected.xkb create mode 100644 test_files/compile-tests/t00/t008/t0083/input.xkb create mode 100644 test_files/compile-tests/t00/t008/t0084/expected.xkb create mode 100644 test_files/compile-tests/t00/t008/t0084/input.xkb create mode 100644 test_files/compile-tests/t00/t008/t0085/expected.xkb create mode 100644 test_files/compile-tests/t00/t008/t0085/input.xkb create mode 100644 test_files/compile-tests/t00/t008/t0086/expected.xkb create mode 100644 test_files/compile-tests/t00/t008/t0086/input.xkb create mode 100644 test_files/compile-tests/t00/t008/t0087/expected.xkb create mode 100644 test_files/compile-tests/t00/t008/t0087/input.xkb create mode 100644 test_files/compile-tests/t00/t008/t0088/expected.xkb create mode 100644 test_files/compile-tests/t00/t008/t0088/input.xkb create mode 100644 test_files/compile-tests/t00/t008/t0089/expected.xkb create mode 100644 test_files/compile-tests/t00/t008/t0089/input.xkb create mode 100644 test_files/compile-tests/t00/t009/t0090/expected.xkb create mode 100644 test_files/compile-tests/t00/t009/t0090/input.xkb create mode 100644 test_files/compile-tests/t00/t009/t0091/expected.xkb create mode 100644 test_files/compile-tests/t00/t009/t0091/input.xkb create mode 100644 test_files/compile-tests/t00/t009/t0093/compat/x.xkb create mode 100644 test_files/compile-tests/t00/t009/t0093/expected.xkb create mode 100644 test_files/compile-tests/t00/t009/t0093/input.xkb create mode 100644 test_files/compile-tests/t00/t009/t0094/expected.xkb create mode 100644 test_files/compile-tests/t00/t009/t0094/input.xkb create mode 100644 test_files/compile-tests/t00/t009/t0095/expected.xkb create mode 100644 test_files/compile-tests/t00/t009/t0095/input.xkb create mode 100644 test_files/compile-tests/t00/t009/t0096/expected.xkb create mode 100644 test_files/compile-tests/t00/t009/t0096/input.xkb create mode 100644 test_files/compile-tests/t00/t009/t0099/expected.xkb create mode 100644 test_files/compile-tests/t00/t009/t0099/input.xkb create mode 100644 test_files/compile-tests/t01/t010/t0102/expected.xkb create mode 100644 test_files/compile-tests/t01/t010/t0102/input.xkb create mode 100644 test_files/compile-tests/t01/t010/t0102/symbols/x.xkb create mode 100644 test_files/compile-tests/t01/t010/t0105/expected.xkb create mode 100644 test_files/compile-tests/t01/t010/t0105/input.xkb create mode 100644 test_files/compile-tests/t01/t011/t0110/expected.xkb create mode 100644 test_files/compile-tests/t01/t011/t0110/input.xkb create mode 100644 test_files/compile-tests/t01/t011/t0111/expected.xkb create mode 100644 test_files/compile-tests/t01/t011/t0111/input.xkb create mode 100644 test_files/compile-tests/t01/t011/t0112/expected.xkb create mode 100644 test_files/compile-tests/t01/t011/t0112/input.xkb create mode 100644 test_files/compile-tests/t01/t011/t0113/expected.xkb create mode 100644 test_files/compile-tests/t01/t011/t0113/input.xkb create mode 100644 test_files/compile-tests/t01/t011/t0114/expected.xkb create mode 100644 test_files/compile-tests/t01/t011/t0114/input.xkb create mode 100644 test_files/compile-tests/t01/t011/t0115/expected.xkb create mode 100644 test_files/compile-tests/t01/t011/t0115/input.xkb create mode 100644 test_files/compile-tests/t01/t011/t0116/expected.xkb create mode 100644 test_files/compile-tests/t01/t011/t0116/input.xkb create mode 100644 test_files/compile-tests/t01/t011/t0119/expected.xkb create mode 100644 test_files/compile-tests/t01/t011/t0119/input.xkb create mode 100644 test_files/compile-tests/t01/t012/t0120/expected.xkb create mode 100644 test_files/compile-tests/t01/t012/t0120/input.xkb create mode 100644 test_files/compile-tests/t01/t012/t0126/expected.xkb create mode 100644 test_files/compile-tests/t01/t012/t0126/input.xkb create mode 100644 test_files/compile-tests/t01/t012/t0127/expected.xkb create mode 100644 test_files/compile-tests/t01/t012/t0127/input.xkb create mode 100644 test_files/compile-tests/t01/t012/t0128/expected.xkb create mode 100644 test_files/compile-tests/t01/t012/t0128/input.xkb create mode 100644 test_files/compile-tests/t01/t012/t0128/symbols/x.xkb create mode 100644 test_files/compile-tests/t01/t012/t0129/expected.xkb create mode 100644 test_files/compile-tests/t01/t012/t0129/input.xkb create mode 100644 test_files/compile-tests/t01/t012/t0129/symbols/x.xkb create mode 100644 test_files/compile-tests/t01/t013/t0130/expected.xkb create mode 100644 test_files/compile-tests/t01/t013/t0130/input.xkb create mode 100644 test_files/compile-tests/t01/t013/t0130/symbols/x.xkb create mode 100644 test_files/compile-tests/t01/t013/t0135/expected.xkb create mode 100644 test_files/compile-tests/t01/t013/t0135/input.xkb create mode 100644 test_files/compile-tests/t01/t013/t0137/expected.xkb create mode 100644 test_files/compile-tests/t01/t013/t0137/input.xkb create mode 100644 test_files/compile-tests/t01/t013/t0138/expected.xkb create mode 100644 test_files/compile-tests/t01/t013/t0138/input.xkb create mode 100644 test_files/compile-tests/t01/t015/t0153/expected.xkb create mode 100644 test_files/compile-tests/t01/t015/t0153/input.xkb create mode 100644 test_files/compile-tests/t02/t025/t0252/expected.xkb create mode 100644 test_files/compile-tests/t02/t025/t0252/input.xkb create mode 100644 test_files/compile-tests/t02/t025/t0252/keycodes/a.xkb create mode 100644 test_files/compile-tests/t02/t025/t0253/expected.xkb create mode 100644 test_files/compile-tests/t02/t025/t0253/input.xkb create mode 100644 test_files/compile-tests/t02/t025/t0253/keycodes/a.xkb create mode 100644 test_files/compile-tests/t02/t025/t0254/compat/a.xkb create mode 100644 test_files/compile-tests/t02/t025/t0254/expected.xkb create mode 100644 test_files/compile-tests/t02/t025/t0254/input.xkb create mode 100644 test_files/compile-tests/t02/t025/t0255/compat/a.xkb create mode 100644 test_files/compile-tests/t02/t025/t0255/expected.xkb create mode 100644 test_files/compile-tests/t02/t025/t0255/input.xkb create mode 100644 test_files/compile-tests/t02/t025/t0256/expected.xkb create mode 100644 test_files/compile-tests/t02/t025/t0256/input.xkb create mode 100644 test_files/compile-tests/t02/t025/t0257/expected.xkb create mode 100644 test_files/compile-tests/t02/t025/t0257/input.xkb create mode 100644 test_files/compile-tests/t02/t025/t0258/expected.xkb create mode 100644 test_files/compile-tests/t02/t025/t0258/input.xkb create mode 100644 test_files/compile-tests/t02/t025/t0259/expected.xkb create mode 100644 test_files/compile-tests/t02/t025/t0259/input.xkb create mode 100644 test_files/compile-tests/t02/t025/t0259/keycodes/a.xkb create mode 100644 test_files/compile-tests/t02/t026/t0262/expected.xkb create mode 100644 test_files/compile-tests/t02/t026/t0262/input.xkb create mode 100644 test_files/compile-tests/t02/t026/t0266/expected.xkb create mode 100644 test_files/compile-tests/t02/t026/t0266/input.xkb create mode 100644 test_files/compile-tests/t02/t026/t0268/expected.xkb create mode 100644 test_files/compile-tests/t02/t026/t0268/input.xkb create mode 100644 test_files/compile-tests/t02/t026/t0269/expected.xkb create mode 100644 test_files/compile-tests/t02/t026/t0269/input.xkb create mode 100644 test_files/compile-tests/t02/t027/t0274/expected.xkb create mode 100644 test_files/compile-tests/t02/t027/t0274/extra-includes/keycodes/x.xkb create mode 100644 test_files/compile-tests/t02/t027/t0274/input.xkb create mode 100644 test_files/compile-tests/t02/t027/t0274/keycodes/x.xkb create mode 100644 test_files/compile-tests/t02/t027/t0275/expected.xkb create mode 100644 test_files/compile-tests/t02/t027/t0275/extra-includes/keycodes/x.xkb create mode 100644 test_files/compile-tests/t02/t027/t0275/input.xkb create mode 100644 test_files/compile-tests/t02/t027/t0275/keycodes/x.xkb create mode 100644 test_files/compile-tests/t02/t027/t0276/expected.xkb create mode 100644 test_files/compile-tests/t02/t027/t0276/input.xkb create mode 100644 test_files/compile-tests/t02/t027/t0276/keycodes/x.xkb create mode 100644 test_files/compile-tests/t02/t027/t0278/expected.xkb create mode 100644 test_files/compile-tests/t02/t027/t0278/input.xkb create mode 100644 test_files/compile-tests/t02/t027/t0278/keycodes/x.xkb create mode 100644 test_files/compile-tests/t02/t028/t0282/expected.xkb create mode 100644 test_files/compile-tests/t02/t028/t0282/input.xkb create mode 100644 test_files/compile-tests/t02/t028/t0282/keycodes/x.xkb create mode 100644 test_files/compile-tests/t02/t028/t0283/expected.xkb create mode 100644 test_files/compile-tests/t02/t028/t0283/input.xkb create mode 100644 test_files/compile-tests/t02/t028/t0283/keycodes/x.xkb create mode 100644 test_files/compile-tests/t02/t028/t0284/expected.xkb create mode 100644 test_files/compile-tests/t02/t028/t0284/input.xkb create mode 100644 test_files/compile-tests/t02/t028/t0284/keycodes/x.xkb create mode 100644 test_files/compile-tests/t02/t028/t0285/expected.xkb create mode 100644 test_files/compile-tests/t02/t028/t0285/input.xkb create mode 100644 test_files/compile-tests/t02/t028/t0287/expected.xkb create mode 100644 test_files/compile-tests/t02/t028/t0287/input.xkb create mode 100644 test_files/compile-tests/t02/t028/t0287/keycodes/x.xkb create mode 100644 test_files/compile-tests/t02/t028/t0287/keycodes/y.xkb create mode 100644 test_files/compile-tests/t02/t028/t0288/expected.xkb create mode 100644 test_files/compile-tests/t02/t028/t0288/input.xkb create mode 100644 test_files/compile-tests/t02/t028/t0289/expected.xkb create mode 100644 test_files/compile-tests/t02/t028/t0289/input.xkb create mode 100644 test_files/compile-tests/t02/t029/t0290/expected.xkb create mode 100644 test_files/compile-tests/t02/t029/t0290/input.xkb create mode 100644 test_files/compile-tests/t02/t029/t0291/expected.xkb create mode 100644 test_files/compile-tests/t02/t029/t0291/input.xkb create mode 100644 test_files/compile-tests/t02/t029/t0292/expected.xkb create mode 100644 test_files/compile-tests/t02/t029/t0292/input.xkb create mode 100644 test_files/compile-tests/t02/t029/t0296/expected.xkb create mode 100644 test_files/compile-tests/t02/t029/t0296/input.xkb create mode 100644 test_files/compile-tests/t03/t031/t0310/expected.xkb create mode 100644 test_files/compile-tests/t03/t031/t0310/input.xkb create mode 100644 test_files/compile-tests/t03/t031/t0311/expected.xkb create mode 100644 test_files/compile-tests/t03/t031/t0311/input.xkb create mode 100644 test_files/compile-tests/t03/t031/t0312/expected.xkb create mode 100644 test_files/compile-tests/t03/t031/t0312/input.xkb create mode 100644 test_files/compile-tests/t03/t033/t0337/expected.xkb create mode 100644 test_files/compile-tests/t03/t033/t0337/input.xkb create mode 100644 test_files/compile-tests/t03/t033/t0339/expected.xkb create mode 100644 test_files/compile-tests/t03/t033/t0339/input.xkb create mode 100644 test_files/compile-tests/t03/t034/t0340/expected.xkb create mode 100644 test_files/compile-tests/t03/t034/t0340/input.xkb create mode 100644 test_files/compile-tests/t03/t034/t0341/expected.xkb create mode 100644 test_files/compile-tests/t03/t034/t0341/input.xkb create mode 100644 test_files/compile-tests/t03/t034/t0342/expected.xkb create mode 100644 test_files/compile-tests/t03/t034/t0342/input.xkb create mode 100644 test_files/compile-tests/t03/t034/t0345/expected.xkb create mode 100644 test_files/compile-tests/t03/t034/t0345/input.xkb create mode 100644 test_files/compile-tests/t03/t034/t0348/expected.xkb create mode 100644 test_files/compile-tests/t03/t034/t0348/input.xkb create mode 100644 test_files/compile-tests/t03/t034/t0349/expected.xkb create mode 100644 test_files/compile-tests/t03/t034/t0349/input.xkb create mode 100644 test_files/compile-tests/t03/t035/t0359/expected.xkb create mode 100644 test_files/compile-tests/t03/t035/t0359/input.xkb create mode 100644 test_files/compile-tests/t03/t036/t0361/expected.xkb create mode 100644 test_files/compile-tests/t03/t036/t0361/input.xkb create mode 100644 test_files/compile-tests/t03/t036/t0367/expected.xkb create mode 100644 test_files/compile-tests/t03/t036/t0367/input.xkb create mode 100644 test_files/compile-tests/t03/t037/t0370/expected.xkb create mode 100644 test_files/compile-tests/t03/t037/t0370/input.xkb create mode 100644 test_files/compile-tests/t03/t037/t0370/symbols/a.xkb create mode 100644 test_files/compile-tests/t03/t038/t0384/expected.xkb create mode 100644 test_files/compile-tests/t03/t038/t0384/input.xkb create mode 100644 test_files/compile-tests/t03/t038/t0385/expected.xkb create mode 100644 test_files/compile-tests/t03/t038/t0385/input.xkb create mode 100644 test_files/compile-tests/t03/t039/t0390/expected.xkb create mode 100644 test_files/compile-tests/t03/t039/t0390/input.xkb create mode 100644 test_files/compile-tests/t03/t039/t0391/expected.xkb create mode 100644 test_files/compile-tests/t03/t039/t0391/input.xkb create mode 100644 test_files/compile-tests/t03/t039/t0392/expected.xkb create mode 100644 test_files/compile-tests/t03/t039/t0392/input.xkb create mode 100644 test_files/compile-tests/t03/t039/t0394/expected.xkb create mode 100644 test_files/compile-tests/t03/t039/t0394/input.xkb create mode 100644 test_files/compile-tests/t03/t039/t0394/symbols/a.xkb create mode 100644 test_files/compile-tests/t04/t041/t0411/expected.xkb create mode 100644 test_files/compile-tests/t04/t041/t0411/input.xkb create mode 100644 test_files/compile-tests/t04/t041/t0412/expected.xkb create mode 100644 test_files/compile-tests/t04/t041/t0412/input.xkb create mode 100644 test_files/compile-tests/t04/t041/t0413/expected.xkb create mode 100644 test_files/compile-tests/t04/t041/t0413/input.xkb create mode 100644 test_files/compile-tests/t04/t041/t0414/expected.xkb create mode 100644 test_files/compile-tests/t04/t041/t0414/input.xkb create mode 100644 test_files/compile-tests/t04/t041/t0415/expected.xkb create mode 100644 test_files/compile-tests/t04/t041/t0415/input.xkb create mode 100644 test_files/compile-tests/t04/t041/t0416/expected.xkb create mode 100644 test_files/compile-tests/t04/t041/t0416/input.xkb create mode 100644 test_files/compile-tests/t04/t042/t0421/expected.xkb create mode 100644 test_files/compile-tests/t04/t042/t0421/input.xkb create mode 100644 test_files/compile-tests/t04/t042/t0422/expected.xkb create mode 100644 test_files/compile-tests/t04/t042/t0422/input.xkb create mode 100644 test_files/compile-tests/t04/t042/t0423/expected.xkb create mode 100644 test_files/compile-tests/t04/t042/t0423/input.xkb create mode 100644 test_files/compile-tests/t04/t042/t0424/expected.xkb create mode 100644 test_files/compile-tests/t04/t042/t0424/input.xkb create mode 100644 test_files/compile-tests/t04/t042/t0425/expected.xkb create mode 100644 test_files/compile-tests/t04/t042/t0425/input.xkb create mode 100644 test_files/compile-tests/t04/t043/t0430/expected.xkb create mode 100644 test_files/compile-tests/t04/t043/t0430/input.xkb create mode 100644 test_files/compile-tests/t04/t043/t0431/expected.xkb create mode 100644 test_files/compile-tests/t04/t043/t0431/input.xkb create mode 100644 test_files/compile-tests/t04/t043/t0435/expected.xkb create mode 100644 test_files/compile-tests/t04/t043/t0435/input.xkb create mode 100644 test_files/compile-tests/t04/t043/t0437/expected.xkb create mode 100644 test_files/compile-tests/t04/t043/t0437/input.xkb create mode 100644 test_files/compile-tests/t04/t043/t0438/expected.xkb create mode 100644 test_files/compile-tests/t04/t043/t0438/input.xkb create mode 100644 test_files/compile-tests/t04/t043/t0439/expected.xkb create mode 100644 test_files/compile-tests/t04/t043/t0439/input.xkb create mode 100644 test_files/compile-tests/t04/t044/t0440/expected.xkb create mode 100644 test_files/compile-tests/t04/t044/t0440/input.xkb create mode 100644 test_files/compile-tests/t04/t044/t0443/expected.xkb create mode 100644 test_files/compile-tests/t04/t044/t0443/input.xkb create mode 100644 test_files/compile-tests/t04/t044/t0445/expected.xkb create mode 100644 test_files/compile-tests/t04/t044/t0445/input.xkb create mode 100644 test_files/compile-tests/t04/t044/t0449/expected.xkb create mode 100644 test_files/compile-tests/t04/t044/t0449/input.xkb create mode 100644 test_files/compile-tests/t04/t045/t0450/expected.xkb create mode 100644 test_files/compile-tests/t04/t045/t0450/input.xkb create mode 100644 test_files/compile-tests/t04/t045/t0451/expected.xkb create mode 100644 test_files/compile-tests/t04/t045/t0451/input.xkb create mode 100644 test_files/compile-tests/t04/t045/t0452/expected.xkb create mode 100644 test_files/compile-tests/t04/t045/t0452/input.xkb create mode 100644 test_files/compile-tests/t04/t046/t0460/expected.xkb create mode 100644 test_files/compile-tests/t04/t046/t0460/input.xkb create mode 100644 test_files/compile-tests/t04/t046/t0461/expected.xkb create mode 100644 test_files/compile-tests/t04/t046/t0461/input.xkb create mode 100644 test_files/compile-tests/t04/t046/t0462/expected.xkb create mode 100644 test_files/compile-tests/t04/t046/t0462/input.xkb create mode 100644 test_files/compile-tests/t04/t048/t0482/expected.xkb create mode 100644 test_files/compile-tests/t04/t048/t0482/input.xkb create mode 100644 test_files/compile-tests/t04/t048/t0483/expected.xkb create mode 100644 test_files/compile-tests/t04/t048/t0483/input.xkb create mode 100644 test_files/compile-tests/t04/t048/t0484/expected.xkb create mode 100644 test_files/compile-tests/t04/t048/t0484/input.xkb create mode 100644 test_files/compile-tests/t04/t048/t0485/expected.xkb create mode 100644 test_files/compile-tests/t04/t048/t0485/input.xkb create mode 100644 test_files/compile-tests/t04/t048/t0486/expected.xkb create mode 100644 test_files/compile-tests/t04/t048/t0486/input.xkb create mode 100644 test_files/compile-tests/t04/t049/t0492/expected.xkb create mode 100644 test_files/compile-tests/t04/t049/t0492/input.xkb create mode 100644 test_files/compile-tests/t04/t049/t0493/expected.xkb create mode 100644 test_files/compile-tests/t04/t049/t0493/input.xkb create mode 100644 test_files/compile-tests/t04/t049/t0494/expected.xkb create mode 100644 test_files/compile-tests/t04/t049/t0494/input.xkb create mode 100644 test_files/type-include/keycodes/generated create mode 100644 test_files/type-tests/.gitattributes create mode 100644 test_files/type-tests/.gitignore create mode 100644 test_files/type-tests/t00/t003/t0038/expected.txt create mode 100644 test_files/type-tests/t00/t003/t0038/input.txt create mode 100644 test_files/type-tests/t00/t003/t0038/map.xkb create mode 100644 test_files/type-tests/t00/t005/t0056/expected.txt create mode 100644 test_files/type-tests/t00/t005/t0056/input.txt create mode 100644 test_files/type-tests/t00/t005/t0056/map.xkb create mode 100644 test_files/type-tests/t00/t006/t0061/expected.txt create mode 100644 test_files/type-tests/t00/t006/t0061/input.txt create mode 100644 test_files/type-tests/t00/t006/t0061/map.xkb create mode 100644 test_files/type-tests/t00/t006/t0062/expected.txt create mode 100644 test_files/type-tests/t00/t006/t0062/input.txt create mode 100644 test_files/type-tests/t00/t006/t0062/map.xkb create mode 100644 test_files/type-tests/t00/t009/t0095/expected.txt create mode 100644 test_files/type-tests/t00/t009/t0095/input.txt create mode 100644 test_files/type-tests/t00/t009/t0095/map.xkb diff --git a/.gitignore b/.gitignore index a5ddb195..8a114c4c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ **/target **/test_files +!/test_files **/Cargo.lock /.vscode /.opencode diff --git a/test_files/compile-include/LICENSE b/test_files/compile-include/LICENSE new file mode 100644 index 00000000..3dcd0391 --- /dev/null +++ b/test_files/compile-include/LICENSE @@ -0,0 +1,215 @@ +The following is a list of all copyright notices and license statements which +appear in the xkbcommon source tree. + +If making new contributions, the first form (i.e. Daniel Stone, Ran Benita, +etc) is vastly preferred. + +All licenses are derivative of the MIT/X11 license, mostly identical other +than no-endorsement clauses (e.g. paragraph 4 of The Open Group's license). + +These statements are split into two sections: one for the code compiled and +distributed as part of the libxkbcommon shared library and the code +component of all tests (i.e. everything under src/ and xkbcommon/, plus the +.c and .h files under test/), and another for the test data under test/data, +which is distributed with the xkbcommon source tarball, but not installed to +the system. + + +BEGINNING OF SOFTWARE COPYRIGHT/LICENSE STATEMENTS: + + +------------------------------------------------------------------------------- + +Copyright © 2009-2012, 2016 Daniel Stone +Copyright © 2012 Ran Benita +Copyright © 2010, 2012 Intel Corporation +Copyright © 2008, 2009 Dan Nicholson +Copyright © 2010 Francisco Jerez + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next +paragraph) shall be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + + +------------------------------------------------------------------------------- + + +Copyright 1985, 1987, 1988, 1990, 1998 The Open Group + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the names of the authors or their +institutions shall not be used in advertising or otherwise to promote the +sale, use or other dealings in this Software without prior written +authorization from the authors. + + +------------------------------------------------------------------------------- + + +Copyright (c) 1993, 1994, 1995, 1996 by Silicon Graphics Computer Systems, Inc. + +Permission to use, copy, modify, and distribute this +software and its documentation for any purpose and without +fee is hereby granted, provided that the above copyright +notice appear in all copies and that both that copyright +notice and this permission notice appear in supporting +documentation, and that the name of Silicon Graphics not be +used in advertising or publicity pertaining to distribution +of the software without specific prior written permission. +Silicon Graphics makes no representation about the suitability +of this software for any purpose. It is provided "as is" +without any express or implied warranty. + +SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS +SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON +GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL +DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH +THE USE OR PERFORMANCE OF THIS SOFTWARE. + + +------------------------------------------------------------------------------- + + +Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + + +------------------------------------------------------------------------------- + + +Copyright (C) 2011 Joseph Adams + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + + +------------------------------------------------------------------------------- + + + +END OF SOFTWARE COPYRIGHT/LICENSE STATEMENTS + + +BEGINNING OF LICENSE STATEMENTS FOR UNDISTRIBUTED DATA FILES IN test/data, +derived from xkeyboard-config: + + + +------------------------------------------------------------------------------- + +Copyright 1996 by Joseph Moss +Copyright (C) 2002-2007 Free Software Foundation, Inc. +Copyright (C) Dmitry Golubev , 2003-2004 +Copyright (C) 2004, Gregory Mokhin +Copyright (C) 2006 Erdal Ronahî + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the name of the copyright holder(s) not be used in +advertising or publicity pertaining to distribution of the software without +specific, written prior permission. The copyright holder(s) makes no +representations about the suitability of this software for any purpose. It +is provided "as is" without express or implied warranty. + +THE COPYRIGHT HOLDER(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +EVENT SHALL THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + + +------------------------------------------------------------------------------- + + Copyright 1992 by Oki Technosystems Laboratory, Inc. + Copyright 1992 by Fuji Xerox Co., Ltd. + +Permission to use, copy, modify, distribute, and sell this software +and its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and +that both that copyright notice and this permission notice appear +in supporting documentation, and that the name of Oki Technosystems +Laboratory and Fuji Xerox not be used in advertising or publicity +pertaining to distribution of the software without specific, written +prior permission. +Oki Technosystems Laboratory and Fuji Xerox make no representations +about the suitability of this software for any purpose. It is provided +"as is" without express or implied warranty. + +OKI TECHNOSYSTEMS LABORATORY AND FUJI XEROX DISCLAIM ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL OKI TECHNOSYSTEMS +LABORATORY AND FUJI XEROX BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE +OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE +OR PERFORMANCE OF THIS SOFTWARE. diff --git a/test_files/compile-include/keycodes/merge_modes b/test_files/compile-include/keycodes/merge_modes new file mode 100644 index 00000000..f38c3879 --- /dev/null +++ b/test_files/compile-include/keycodes/merge_modes @@ -0,0 +1,160 @@ +// WARNING: This file was auto-generated by: scripts/update-symbols-tests.py +default xkb_keycodes "evdev" { + minimum = 8; + maximum = 255; + + = 9; + = 10; + = 11; + = 12; + = 13; + = 14; + = 15; + = 16; + = 17; + = 18; + = 19; + = 20; + = 21; + = 22; + = 23; + = 24; + = 25; + = 26; + = 28; + = 29; + = 30; + = 31; + = 32; + = 33; + = 34; + = 35; + = 36; + = 37; + = 38; + = 39; + = 40; + = 41; + = 42; + = 43; + = 44; + = 45; + = 46; + = 47; + = 51; + = 52; + = 53; + = 54; + = 55; + = 56; + = 57; + = 58; + = 59; + = 60; + = 61; + = 62; + = 63; + = 64; + = 65; + = 68; + = 69; + = 70; + = 71; + = 72; + = 73; + = 74; + = 75; + = 76; + = 77; + = 78; + = 79; + = 80; + = 81; + = 82; + = 83; + = 84; + = 85; + = 86; + = 87; + = 88; + = 89; + = 93; + = 94; + = 95; + = 96; + = 97; + = 98; + = 99; + = 100; + = 101; + = 102; + = 103; + = 104; + = 105; + = 106; + = 107; + = 111; + = 112; + = 113; + = 114; + = 115; + = 116; + = 117; + = 118; + = 119; + = 120; + = 121; + = 122; + = 123; + = 124; + = 125; + = 126; + = 127; + = 128; + = 129; + = 130; + = 131; + = 132; + = 133; + = 134; + = 135; + = 136; + = 137; + = 138; + = 139; + = 140; + = 141; + = 142; + = 143; + = 144; + = 145; + = 146; + = 147; + = 148; + = 149; + = 150; + = 151; + = 152; + = 153; + = 154; + = 155; + = 158; + = 161; + = 164; + = 167; + = 170; + = 173; + = 176; + = 179; + = 182; + = 185; + = 188; + = 191; + = 194; + = 197; + = 200; + = 212; + + = 50; + = 108; +}; diff --git a/test_files/compile-include/rules/all_qualifier b/test_files/compile-include/rules/all_qualifier new file mode 100644 index 00000000..1629c747 --- /dev/null +++ b/test_files/compile-include/rules/all_qualifier @@ -0,0 +1,59 @@ +! model = keycodes + my_model = my_keycodes + * = default_keycodes + +! layout variant = symbols + layout_a my_variant = symbols_a+extra_variant + +! layout = symbols + layout_a = symbols_a + layout_b = symbols_b + * = default_symbols + +! layout[1] = symbols + layout_a = symbols_a:1 + layout_b = symbols_b:1 + layout_x = base:all // strange but valid + * = default_symbols:1 + +! layout[2] = symbols + layout_a = +symbols_a:2 + layout_b = +symbols_b:2 + * = +default_symbols:2 + +! layout[3] = symbols + layout_a = +symbols_a:3 + layout_b = +symbols_b:3 + * = +default_symbols:3 + +! layout[4] = symbols + layout_a = +symbols_a:4 + layout_b = +symbols_b:4 + * = +default_symbols:4 + +// WARNING: Invalid at the moment. Here for future test +! layout[5] = symbols + layout_a = +symbols_a:5 + layout_b = +symbols_b:5 + layout_c = +symbols_c:5 + * = +default_symbols:5 + +// Combine with special indexes +! layout[first] variant[first] = symbols + * extra1 = +extra_symbols:all + +// Combine with special indexes (valid but raises a warning) +! layout[any] variant[any] = symbols + * extra2 = +extra_symbols1:%i+extra_symbols2:all + * extra3 = +extra_symbols2:all+extra_symbols1:%i + +! model = types + my_model = my_types + * = default_types + +! model = compat + my_model = my_compat + * = default_compat + +! option = symbols + my_option = +extra_option:all diff --git a/test_files/compile-include/rules/evdev-modern b/test_files/compile-include/rules/evdev-modern new file mode 100644 index 00000000..5ee4b132 --- /dev/null +++ b/test_files/compile-include/rules/evdev-modern @@ -0,0 +1,715 @@ +// DO NOT EDIT THIS FILE - IT WAS AUTOGENERATED BY merge.py FROM rules/*.part +// +// +// Rules for resolving XKB components for use with XFree86 +// Copyright 1996 by Joseph Moss +// +// 2002 Modifier: Ivan Pascal The XFree86 Project +// + +// If you want non-latin layouts implicitly include the en_US layout +// uncomment lines below +//! $nonlatin = am ara ben bd bg bt by cs deva ge gh gr guj guru il \ +// in ir iku jp kan kh kr la lao lk mk mm mn mv mal olck \ +// ori pk ru scc sy syr tel th tj tam ua uz + +// PC models +! $pcmodels = pc86 pc101 pc102 pc104 pc104alt pc105 + +// Jolla devices and keyboards +! $jollamodels = jollasbj + +// Microsoft models (using MS geometry) +! $msmodels = microsoft microsoft4000 microsoft7000 microsoftpro microsoftprousb microsoftprose microsoftsurface + +// Nokia devices and keyboards +! $nokiamodels = nokiasu8w nokiarx44 nokiarx51 + +// TypeMatrix geometries +! $tmgeometries = tm2020 tm2030PS2 tm2030USB tm2030USB-102 tm2030USB-106 + +// Layouts that provide further specializations for the OLPC +! $olpclayouts = af am ara br ca es et fr it kh kz in mn np ru th tr us + +! $macbooks = macbook78 macbook79 +! $maclaptop = ibook powerbook macbook78 macbook79 +! $applealu = applealu_ansi applealu_iso applealu_jis +! $macs = macintosh macintosh_old ibook powerbook macbook78 macbook79 + +! $macvendorlayouts = ch de dk fi fr gb is it latam nl no pt se us + +! $azerty = be fr +! $qwertz = al cz de hr hu ro si sk + + +// all layouts with 3rd and 4th groups +! $threelevellayouts = al az \ + be br bt \ + ca ch cs cz \ + de dk \ + ee es \ + fi fo fr \ + gb gr \ + hu \ + ie ir is it \ + latam \ + lk lt \ + mn mt \ + nl no \ + pl pt \ + ro \ + se sk \ + tr \ + us \ + vn \ + za + +! $thinkpads = thinkpad thinkpad60 thinkpadz60 + +! $sun = sun_type6_jp sun_type6_usb sun_type6_euro_usb \ + sun_type6_jp_usb sun_type6_unix_usb sun_type7_jp_usb \ + sun_type7_usb sun_type7_euro_usb sun_type7_unix_usb + +! $sun_jp = sun_type6_jp sun_type6_jp_usb sun_type7_jp_usb + +// Sun Type_6_7 keyboards with custom layouts +! $sun_custom = ara be br ca ch cz de dk \ + ee es fi fr gb gr it jp \ + kr lt lv nl no pl pt ro \ + ru se sk tr tw ua us + +! $sun_var = sun_type6 sun_type6_suncompat sun_type6_de sun_type6_fr \ + sun_type7 sun_type7_suncompat suncompat + +! $sun_compat = sun_type6 sun_type6_suncompat sun_type7_suncompat suncompat + + +! $evdevkbds = ibm_spacesaver + +! $dvoraklayouts = br ca de ee es fr gb no pl se us + +! model = keycodes + applealu_jis = evdev+macintosh(jisevdev) + $jollamodels = evdev+jolla(jolla) + olpc = evdev+olpc(olpc) + olpcm = evdev+olpc(olpcm) + * = evdev + +! layout[1] = keycodes + $azerty = +aliases(azerty) + $qwertz = +aliases(qwertz) + * = +aliases(qwerty) + +! layout = keycodes + $azerty = +aliases(azerty) + $qwertz = +aliases(qwertz) + * = +aliases(qwerty) + +! option = keycodes + +! model layout = geometry + thinkpad us = thinkpad(us) + +! model = geometry + microsoftelite = microsoft(elite) + $msmodels = microsoft(natural) + dell101 = dell(dell101) + dellm65 = dell(dellm65) + latitude = dell(latitude) + flexpro = keytronic(FlexPro) + hp6000 = hp(omnibook) + hpmini110 = hp(mini110) + hpdv5 = hp(dv5) + omnikey101 = northgate(omnikey101) + sanwaskbkg3 = sanwa(sanwaskbkg3) + $pcmodels = pc(%m) + everex = everex(STEPnote) + thinkpad = thinkpad(intl) + thinkpad60 = thinkpad(60) + thinkpadz60 = thinkpad(60) + apex300 = steelseries(apex300) + $tmgeometries = typematrix(%m) + winbook = winbook(XP5) + pc98 = nec(pc98) + $applealu = macintosh(%m) + $macbooks = macintosh(%m) + $macs = macintosh(macintosh) + hhk = hhk(basic) + kinesis = kinesis(model100) + $nokiamodels = nokia(%m) + sun_type6_jp = sun(type6jp) + sun_type6_usb = sun(type6) + sun_type6_euro_usb = sun(type6tuv) + sun_type6_jp_usb = sun(type6jp) + sun_type6_unix_usb = sun(type6unix) + sun_type7_jp_usb = sun(type6jp) + sun_type7_usb = sun(type7) + sun_type7_euro_usb = sun(type7tuv) + sun_type7_unix_usb = sun(type7unix) + * = pc(pc104) + +! model layout[first] variant[first] = symbols + * ben basic = pc+in(ben) + * ben probhat = pc+in(ben_probhat) + * dev basic = pc+in(deva) + * dvorak $dvoraklayouts = pc+%v(dvorak) + * dvorak basic = pc+us(dvorak) + * dvorak pl_basic = pc+pl(dvorak) + * dvorak pl = pc+pl(dvorak_quotes) + * dvorak pl_altquotes = pc+pl(dvorak_altquotes) + * dzdwi basic = pc+bt(basic) + * fi basic = pc+fi(classic) + * ge azerty_tskapo = pc+fr(geo) + * guj basic = pc+in(guj) + * gur basic = pc+in(guru) + * ie laptop = pc+ie(basic) + * ie CloGaelachLaptop = pc+ie(CloGaelach) + * in urd = pc+in(urd-phonetic) + * iu basic = pc+ca(ike) + * lo basic = pc+la(basic) + * kan basic = pc+in(kan) + * mal basic = pc+in(mal) + * mal mlplusnum = pc+in(mal) + * ogham basic = pc+ie(ogam) + * ogham laptop = pc+ie(ogam) + * ogham is434 = pc+ie(ogam_is434) + * ogham is434laptop = pc+ie(ogam_is434) + * ori basic = pc+in(ori) + * ro de = pc+ro(winkeys) + * ro us = pc+ro(std) + * ro academic = pc+ro(std) + * ro std_comma = pc+ro(std) + * ro comma = pc+ro(basic) + * ru os = pc+ru(os_legacy) + * pk urd = pc+pk(urd-phonetic) + * sapmi basic = pc+no(smi) + * sapmi nodeadkeys = pc+no(smi_nodeadkeys) + * sapmi sefi = pc+fi(smi) + * sin phonetic-static = pc+in(sin_phonetic) + * syr basic = pc+sy(syc) + * syr phonetic = pc+sy(syc_phonetic) + * tam INSCRIPT = pc+in(tam) + * tam UNI = pc+in(tam_unicode) + * tam NUMERAL-KEYBOARD = pc+in(tam_keyboard_with_numerals) + * tam TAB = pc+in(tam_TAB) + * tam TSCII = pc+in(tam_TSCII) + * tel basic = pc+in(tel) + * yu basic = pc+srp(latin) + * yu unicode = pc+srp(latinunicode) + * yu yz = pc+srp(latinyz) + * yu unicodeyz = pc+srp(latinunicodeyz) + classmate us intl = pc+us(classmate-intl) + classmate us alt-intl = pc+us(classmate-alt-intl) + classmate us altgr-intl = pc+us(classmate-altgr-intl) + nokiarx51 cz qwerty = nokia_vndr/rx-51(cz_qwerty) + * $sun_custom $sun_var = pc+sun_vndr/%l%(v) + +! model layout[first] = symbols + * ar = pc+ara + * ben = pc+in(ben) + * bs = pc+ba + * cs = pc+rs + * cz_qwerty = pc+cz(qwerty) + * dev = pc+in(deva) + * dvorak = pc+us(dvorak) + * dzdwi = pc+bt + * el = pc+gr + * en_US = pc+latin + * guj = pc+in(guj) + * gur = pc+in(guru) + * iu = pc+ca(ike) + * lo = pc+la + * kan = pc+in(kan) + * mi = pc+mao + * ogham = pc+ie(ogam) + * ori = pc+ie(ori) + * sapmi = pc+no(smi) + * sr = pc+srp + * syr = pc+sy(syc) + * tel = pc+in(tel) + * tml = pc+in(tam) + * yu = pc+srp + * fr-latin9 = pc+fr(latin9) + * us_intl = pc+us(alt-intl) + * ben(basic) = pc+in(ben) + * ben(probhat) = pc+in(ben_probhat) + * dev(basic) = pc+in(deva) + * dvorak($dvoraklayouts) = pc+%v(dvorak) + * dvorak(basic) = pc+us(dvorak) + * dvorak(pl_basic) = pc+pl(dvorak) + * dvorak(pl) = pc+pl(dvorak_quotes) + * dvorak(pl_altquotes) = pc+pl(dvorak_altquotes) + * dzdwi(basic) = pc+bt(basic) + * fi(basic) = pc+fi(classic) + * ge(azerty_tskapo) = pc+fr(geo) + * guj(basic) = pc+in(guj) + * gur(basic) = pc+in(guru) + * ie(laptop) = pc+ie(basic) + * ie(CloGaelachLaptop) = pc+ie(CloGaelach) + * in(urd) = pc+in(urd-phonetic) + * iu(basic) = pc+ca(ike) + * lo(basic) = pc+la(basic) + * kan(basic) = pc+in(kan) + * mal(basic) = pc+in(mal) + * mal(mlplusnum) = pc+in(mal) + * ogham(basic) = pc+ie(ogam) + * ogham(laptop) = pc+ie(ogam) + * ogham(is434) = pc+ie(ogam_is434) + * ogham(is434laptop) = pc+ie(ogam_is434) + * ori(basic) = pc+in(ori) + * ro(de) = pc+ro(winkeys) + * ro(us) = pc+ro(std) + * ro(academic) = pc+ro(std) + * ro(std_comma) = pc+ro(std) + * ro(comma) = pc+ro(basic) + * ru(os) = pc+ru(os_legacy) + * pk(urd) = pc+pk(urd-phonetic) + * sapmi(basic) = pc+no(smi) + * sapmi(nodeadkeys) = pc+no(smi_nodeadkeys) + * sapmi(sefi) = pc+fi(smi) + * sin(phonetic-static) = pc+in(sin_phonetic) + * syr(basic) = pc+sy(syc) + * syr(phonetic) = pc+sy(syc_phonetic) + * tam(INSCRIPT) = pc+in(tam) + * tam(UNI) = pc+in(tam_unicode) + * tam(NUMERAL-KEYBOARD) = pc+in(tam_keyboard_with_numerals) + * tam(TAB) = pc+in(tam_TAB) + * tam(TSCII) = pc+in(tam_TSCII) + * tel(basic) = pc+in(tel) + * yu(basic) = pc+srp(latin) + * yu(unicode) = pc+srp(latinunicode) + * yu(yz) = pc+srp(latinyz) + * yu(unicodeyz) = pc+srp(latinunicodeyz) + +! model layout = symbols + ataritt $nonlatin = xfree68_vndr/ataritt(us)+%l[%i]%(v[%i]):2 + ataritt * = xfree68_vndr/ataritt(us)+%l[%i]%(v[%i]) + amiga $nonlatin = xfree68_vndr/amiga(usa1)+%l[%i]%(v[%i]):2 + amiga * = xfree68_vndr/amiga(usa1)+%l[%i]%(v[%i]) + classmate us = pc+%l[%i](classmate) + empty * = empty(basic) + * empty = empty(basic) + jollasbj $nonlatin = jolla_vndr/sbj(common)+us+%l[%i]%(v[%i]):2 + jollasbj * = jolla_vndr/sbj(common)+%l[%i]%(v[%i]) + $sun $sun_custom = pc+sun_vndr/%l[%i]%(v[%i]) + pc98 nec_vndr/jp = nec_vndr/jp(pc98) + macintosh_old us = macintosh_vndr/us(oldmac) + macintosh_old en_US = macintosh_vndr/us(oldmac) + macintosh_old $macvendorlayouts = macintosh_vndr/us(oldmac)+macintosh_vndr/%l%(v) + macintosh_old $nonlatin = macintosh_vndr/us(oldmac)+%l[%i]%(v[%i]):2 + macintosh_old * = macintosh_vndr/us(oldmac)+%l[%i]%(v[%i]) + applealu_jis jp = macintosh_vndr/apple(alukbd)+macintosh_vndr/jp(usmac)+macintosh_vndr/jp(mac):2 + applealu_jis * = macintosh_vndr/apple(alukbd)+%l[%i]%(v[%i])+macintosh_vndr/jp(mac):2 + $applealu $macvendorlayouts = macintosh_vndr/apple(alukbd)+macintosh_vndr/%l[%i]%(v[%i]) + $applealu * = macintosh_vndr/apple(alukbd)+%l[%i]%(v[%i]) + $macs en_US = pc+macintosh_vndr/us(extended) + $macs $macvendorlayouts = pc+macintosh_vndr/%l[%i]%(v[%i]) + nokiarx44 * = nokia_vndr/rx-44(%l[%i]) + nokiarx51 cz(qwerty) = nokia_vndr/rx-51(common)+nokia_vndr/rx-51(cz_qwerty) + nokiarx51 * = nokia_vndr/rx-51(common)+nokia_vndr/rx-51(%l[%i]%_v[%i]) + nokiasu8w * = nokia_vndr/su-8w(%l[%i]) + olpc $olpclayouts = olpc+%l[%i]%(m) + olpc * = olpc+%l[%i]%(v[%i]) + olpcm $olpclayouts = olpc+%l[%i]%(m) + olpcm * = olpc+%l[%i]%(v[%i]) + $thinkpads br = pc+br(thinkpad) + sl-c3x00 * = pc+sharp_vndr/sl-c3x00(basic) + ws003sh * = pc+sharp_vndr/ws003sh(basic) + ws007sh * = pc+sharp_vndr/ws007sh(basic) + ws011sh * = pc+sharp_vndr/ws011sh(basic) + ws020sh * = pc+sharp_vndr/ws020sh(basic) + * $nonlatin = pc+us+%l[%i]%(v[%i]):2 + +! model layout[first] = symbols + * * = pc+%l[%i]%(v[%i]) + +! model layout[later] = symbols + * ar = +ara%(v[%i]):%i + * ben = +in(ben):%i + * bs = +ba%(v[%i]):%i + * cs = +rs%(v[%i]):%i + * cz_qwerty = +cz(qwerty):%i + * dev = +in(deva):%i + * dvorak = +us(dvorak):%i + * dzdwi = +bt%(v[%i]):%i + * el = +gr%(v[%i]):%i + * en_US = +latin%(v[%i]):%i + * guj = +in(guj):%i + * gur = +in(guru):%i + * iu = +ca(ike):%i + * lo = +la%(v[%i]):%i + * kan = +in(kan):%i + * mi = +mao%(v[%i]):%i + * ogham = +ie(ogam):%i + * ori = +ie(ori):%i + * sapmi = +no(smi):%i + * sr = +srp%(v[%i]):%i + * syr = +sy(syc):%i + * tel = +in(tel):%i + * tml = +in(tam):%i + * yu = +srp%(v[%i]):%i + * fr-latin9 = +fr(latin9):%i + * us_intl = +us(alt-intl):%i + * ben(basic) = +in(ben):%i + * ben(probhat) = +in(ben_probhat):%i + * dev(basic) = +in(deva):%i + * dvorak($dvoraklayouts) = +%v(dvorak):%i + * dvorak(basic) = +us(dvorak):%i + * dvorak(pl_basic) = +pl(dvorak):%i + * dvorak(pl) = +pl(dvorak_quotes):%i + * dvorak(pl_altquotes) = +pl(dvorak_altquotes):%i + * dzdwi(basic) = +bt(basic):%i + * fi(basic) = +fi(classic):%i + * ge(azerty_tskapo) = +fr(geo):%i + * guj(basic) = +in(guj):%i + * gur(basic) = +in(guru):%i + * ie(laptop) = +ie(basic):%i + * ie(CloGaelachLaptop) = +ie(CloGaelach):%i + * in(urd) = +in(urd-phonetic):%i + * iu(basic) = +ca(ike):%i + * lo(basic) = +la(basic):%i + * kan(basic) = +in(kan):%i + * mal(basic) = +in(mal):%i + * mal(mlplusnum) = +in(mal):%i + * ogham(basic) = +ie(ogam):%i + * ogham(laptop) = +ie(ogam):%i + * ogham(is434) = +ie(ogam_is434):%i + * ogham(is434laptop) = +ie(ogam_is434):%i + * ori(basic) = +in(ori):%i + * ro(de) = +ro(winkeys):%i + * ro(us) = +ro(std):%i + * ro(academic) = +ro(std):%i + * ro(std_comma) = +ro(std):%i + * ro(comma) = +ro(basic):%i + * ru(os) = +ru(os_legacy):%i + * pk(urd) = +pk(urd-phonetic):%i + * sapmi(basic) = +no(smi):%i + * sapmi(nodeadkeys) = +no(smi_nodeadkeys):%i + * sapmi(sefi) = +fi(smi):%i + * sin(phonetic-static) = +in(sin_phonetic):%i + * syr(basic) = +sy(syc):%i + * syr(phonetic) = +sy(syc_phonetic):%i + * tam(INSCRIPT) = +in(tam):%i + * tam(UNI) = +in(tam_unicode):%i + * tam(NUMERAL-KEYBOARD) = +in(tam_keyboard_with_numerals):%i + * tam(TAB) = +in(tam_TAB):%i + * tam(TSCII) = +in(tam_TSCII):%i + * tel(basic) = +in(tel):%i + * yu(basic) = +srp(latin):%i + * yu(unicode) = +srp(latinunicode):%i + * yu(yz) = +srp(latinyz):%i + * yu(unicodeyz) = +srp(latinunicodeyz):%i + nokiarx51 cz(qwerty) = +nokia_vndr/rx-51(cz_qwerty):%i + nokiarx51 * = +nokia_vndr/rx-51(%l[%i]%_v[%i]):%i + $sun $sun_custom = +sun_vndr/%l[%i]%(v[%i]):%i + * * = +%l[%i]%(v[%i]):%i + +! model layout[later] variant[later] = symbols + * ben basic = +in(ben):%i + * ben probhat = +in(ben_probhat):%i + * dev basic = +in(deva):%i + * dvorak $dvoraklayouts = +%v(dvorak):%i + * dvorak basic = +us(dvorak):%i + * dvorak pl_basic = +pl(dvorak):%i + * dvorak pl = +pl(dvorak_quotes):%i + * dvorak pl_altquotes = +pl(dvorak_altquotes):%i + * dzdwi basic = +bt(basic):%i + * fi basic = +fi(classic):%i + * ge azerty_tskapo = +fr(geo):%i + * guj basic = +in(guj):%i + * gur basic = +in(guru):%i + * ie laptop = +ie(basic):%i + * ie CloGaelachLaptop = +ie(CloGaelach):%i + * in urd = +in(urd-phonetic):%i + * iu basic = +ca(ike):%i + * lo basic = +la(basic):%i + * kan basic = +in(kan):%i + * mal basic = +in(mal):%i + * mal mlplusnum = +in(mal):%i + * ogham basic = +ie(ogam):%i + * ogham laptop = +ie(ogam):%i + * ogham is434 = +ie(ogam_is434):%i + * ogham is434laptop = +ie(ogam_is434):%i + * ori basic = +in(ori):%i + * ro de = +ro(winkeys):%i + * ro us = +ro(std):%i + * ro academic = +ro(std):%i + * ro std_comma = +ro(std):%i + * ro comma = +ro(basic):%i + * ru os = +ru(os_legacy):%i + * pk urd = +pk(urd-phonetic):%i + * sapmi basic = +no(smi):%i + * sapmi nodeadkeys = +no(smi_nodeadkeys):%i + * sapmi sefi = +fi(smi):%i + * sin phonetic-static = +in(sin_phonetic):%i + * syr basic = +sy(syc):%i + * syr phonetic = +sy(syc_phonetic):%i + * tam INSCRIPT = +in(tam):%i + * tam UNI = +in(tam_unicode):%i + * tam NUMERAL-KEYBOARD = +in(tam_keyboard_with_numerals):%i + * tam TAB = +in(tam_TAB):%i + * tam TSCII = +in(tam_TSCII):%i + * tel basic = +in(tel):%i + * yu basic = +srp(latin):%i + * yu unicode = +srp(latinunicode):%i + * yu yz = +srp(latinyz):%i + * yu unicodeyz = +srp(latinunicodeyz):%i + +! model = symbols + $evdevkbds = +inet(evdev)+inet(%m) + chromebook = +inet(evdev)+inet(chromebook) + applealu_jis = +inet(evdev)+macintosh_vndr/jp(alujiskeys) + * = +inet(evdev) + +! layout[any] variant[any] = compat + de neo = +caps(caps_lock):%i+misc(assign_shift_left_action):%i+level5(level5_lock):%i + de adnw = +caps(caps_lock):%i+misc(assign_shift_left_action):%i+level5(level5_lock):%i + de koy = +caps(caps_lock):%i+misc(assign_shift_left_action):%i+level5(level5_lock):%i + de bone = +caps(caps_lock):%i+misc(assign_shift_left_action):%i+level5(level5_lock):%i + de bone_eszett_home = +caps(caps_lock):%i+misc(assign_shift_left_action):%i+level5(level5_lock):%i + de neo_qwertz = +caps(caps_lock):%i+misc(assign_shift_left_action):%i+level5(level5_lock):%i + de neo_qwerty = +caps(caps_lock):%i+misc(assign_shift_left_action):%i+level5(level5_lock):%i + jp $sun_compat = +complete+japan(kana_lock):%i + +! model layout[single] = compat + pc98 nec_vndr/jp = pc98(basic) + * jp = complete+japan + olpc * = olpc + olpcm * = olpc + * * = complete + +! model layout[first] = compat + * * = complete + +! model = types + $macs = complete+numpad(mac) + $applealu = complete+numpad(mac) + $nokiamodels = complete+nokia + * = complete + +! layout[any] option = symbols + $threelevellayouts grp:alts_toggle = +level3(ralt_switch_for_alts_toggle):%i + * misc:apl = +apl(level3):%i + +! option = symbols + grp:shift_toggle = +group(shifts_toggle) + altwin:menu = +altwin(menu) + altwin:menu_win = +altwin(menu_win) + altwin:meta_alt = +altwin(meta_alt) + altwin:alt_win = +altwin(alt_win) + altwin:ctrl_win = +altwin(ctrl_win) + altwin:ctrl_alt_win = +altwin(ctrl_alt_win) + altwin:meta_win = +altwin(meta_win) + altwin:left_meta_win = +altwin(left_meta_win) + altwin:hyper_win = +altwin(hyper_win) + altwin:alt_super_win = +altwin(alt_super_win) + altwin:swap_lalt_lwin = +altwin(swap_lalt_lwin) + altwin:swap_alt_win = +altwin(swap_alt_win) + altwin:prtsc_rwin = +altwin(prtsc_rwin) + grab:debug = +srvr_ctrl(grab_debug) + grp:switch = +group(switch) + grp:lswitch = +group(lswitch) + grp:win_switch = +group(win_switch) + grp:lwin_switch = +group(lwin_switch) + grp:rwin_switch = +group(rwin_switch) + grp:menu_switch = +group(menu_switch) + grp:toggle = +group(toggle) + grp:shifts_toggle = +group(shifts_toggle) + grp:ctrls_toggle = +group(ctrls_toggle) + grp:alts_toggle = +group(alts_toggle) + grp:caps_toggle = +capslock(grouplock) + grp:caps_switch = +capslock(groupshift) + grp:shift_caps_toggle = +group(shift_caps_toggle) + grp:shift_caps_switch = +group(shift_caps_switch) + grp:win_space_toggle = +group(win_space_toggle) + grp:win_menu_switch = +group(win_menu_switch) + grp:alt_caps_toggle = +group(alt_caps_toggle) + grp:alt_space_toggle = +group(alt_space_toggle) + grp:menu_toggle = +group(menu_toggle) + grp:lwin_toggle = +group(lwin_toggle) + grp:rwin_toggle = +group(rwin_toggle) + grp:lshift_toggle = +group(lshift_toggle) + grp:rshift_toggle = +group(rshift_toggle) + grp:rctrl_switch = +group(rctrl_switch) + grp:lctrl_toggle = +group(lctrl_toggle) + grp:rctrl_toggle = +group(rctrl_toggle) + grp:lalt_toggle = +group(lalt_toggle) + grp:sclk_toggle = +group(sclk_toggle) + grp:lctrl_rctrl_switch = +group(lctrl_rctrl_switch) + grp:lctrl_lwin_rctrl_menu = +group(lctrl_lwin_rctrl_menu) + grp:lctrl_lalt_toggle = +group(lctrl_lalt_toggle) + grp:rctrl_ralt_toggle = +group(rctrl_ralt_toggle) + grp:ctrl_alt_toggle = +group(ctrl_alt_toggle) + grp:ctrl_alt_toggle_bidir = +group(ctrl_alt_toggle_bidir) + grp:lctrl_lshift_toggle = +group(lctrl_lshift_toggle) + grp:rctrl_rshift_toggle = +group(rctrl_rshift_toggle) + grp:ctrl_shift_toggle = +group(ctrl_shift_toggle) + grp:ctrl_shift_toggle_bidir = +group(ctrl_shift_toggle_bidir) + grp:lalt_lshift_toggle = +group(lalt_lshift_toggle) + grp:ralt_rshift_toggle = +group(ralt_rshift_toggle) + grp:alt_shift_toggle = +group(alt_shift_toggle) + grp:alt_shift_toggle_bidir = +group(alt_shift_toggle_bidir) + grp:lctrl_lwin_toggle = +group(lctrl_lwin_toggle) + grp:menu_latch_group2 = +group(menu_latch_group2) + grp:menu_latch_group2_lock = +group(menu_latch_group2_lock) + grp:menu_latch = +group(menu_latch) + grp:menu_latch_lock = +group(menu_latch_lock) + grp:menu_latch_negative = +group(menu_latch_negative) + grp:menu_latch_negative_lock = +group(menu_latch_negative_lock) + lv3:switch = +level3(switch) + lv3:ralt_switch = +level3(ralt_switch) + lv3:ralt_switch_multikey = +level3(ralt_switch_multikey) + lv3:ralt_alt = +level3(ralt_alt) + lv3:lalt_switch = +level3(lalt_switch) + lv3:alt_switch = +level3(alt_switch) + lv3:menu_switch = +level3(menu_switch) + lv3:win_switch = +level3(win_switch) + lv3:lwin_switch = +level3(lwin_switch) + lv3:rwin_switch = +level3(rwin_switch) + lv3:enter_switch = +level3(enter_switch) + lv3:4_switch_isolated = +level3(4_switch_isolated) + lv3:9_switch_isolated = +level3(9_switch_isolated) + caps:capslock = +capslock(capslock) + caps:numlock = +capslock(numlock) + caps:shiftlock = +capslock(shiftlock) + caps:swapescape = +capslock(swapescape) + caps:escape = +capslock(escape) + caps:escape_shifted_capslock = +capslock(escape_shifted_capslock) + caps:backspace = +capslock(backspace) + caps:super = +capslock(super) + caps:hyper = +capslock(hyper) + caps:menu = +capslock(menu) + caps:none = +capslock(none) + caps:ctrl_modifier = +capslock(ctrl_modifier) + ctrl:nocaps = +ctrl(nocaps) + ctrl:lctrl_meta = +ctrl(lctrl_meta) + ctrl:swapcaps = +ctrl(swapcaps) + ctrl:swapcaps_hyper = +ctrl(swapcaps_hyper) + ctrl:swapcaps_and_switch_layout = +ctrl(swapcaps_and_switch_layout) + ctrl:ac_ctrl = +ctrl(ac_ctrl) + ctrl:aa_ctrl = +ctrl(aa_ctrl) + ctrl:rctrl_ralt = +ctrl(rctrl_ralt) + ctrl:menu_rctrl = +ctrl(menu_rctrl) + ctrl:ralt_rctrl = +ctrl(ralt_rctrl) + ctrl:swap_lalt_lctl = +ctrl(swap_lalt_lctl) + ctrl:swap_lwin_lctl = +ctrl(swap_lwin_lctl) + ctrl:swap_rwin_rctl = +ctrl(swap_rwin_rctl) + ctrl:swap_lalt_lctl_lwin = +ctrl(swap_lalt_lctl_lwin) + compose:ralt = +compose(ralt) + compose:lwin = +compose(lwin) + compose:lwin-altgr = +compose(lwin-altgr) + compose:rwin = +compose(rwin) + compose:rwin-altgr = +compose(rwin-altgr) + compose:menu = +compose(menu) + compose:menu-altgr = +compose(menu-altgr) + compose:lctrl = +compose(lctrl) + compose:lctrl-altgr = +compose(lctrl-altgr) + compose:rctrl = +compose(rctrl) + compose:rctrl-altgr = +compose(rctrl-altgr) + compose:caps = +compose(caps) + compose:caps-altgr = +compose(caps-altgr) + compose:102 = +compose(102) + compose:102-altgr = +compose(102-altgr) + compose:paus = +compose(paus) + compose:prsc = +compose(prsc) + compose:sclk = +compose(sclk) + srvrkeys:none = +srvr_ctrl(no_srvr_keys) + eurosign:e = +eurosign(e) + eurosign:2 = +eurosign(2) + eurosign:4 = +eurosign(4) + eurosign:5 = +eurosign(5) + rupeesign:4 = +rupeesign(4) + keypad:oss = +keypad(oss) + keypad:legacy = +keypad(legacy) + keypad:legacy_wang = +keypad(legacy_wang) + keypad:oss_wang = +keypad(oss_wang) + keypad:future = +keypad(future) + keypad:future_wang = +keypad(future_wang) + keypad:hex = +keypad(ops)+keypad(hex) + keypad:atm = +keypad(ops)+keypad(hex)+keypad(atm) + nbsp:none = +nbsp(none) + nbsp:level2 = +nbsp(level2) + nbsp:level3 = +nbsp(level3) + nbsp:level3s = +nbsp(level3s) + nbsp:level3n = +nbsp(level3n) + nbsp:level4 = +nbsp(level4) + nbsp:level4n = +nbsp(level4n) + nbsp:level4nl = +nbsp(level4nl) + nbsp:zwnj2 = +nbsp(zwnj2) + nbsp:zwnj2zwj3 = +nbsp(zwnj2zwj3) + nbsp:zwnj2zwj3nb4 = +nbsp(zwnj2zwj3nb4) + nbsp:zwnj2nb3 = +nbsp(zwnj2nb3) + nbsp:zwnj2nb3s = +nbsp(zwnj2nb3s) + nbsp:zwnj2nb3zwj4 = +nbsp(zwnj2nb3zwj4) + nbsp:zwnj2nb3nnb4 = +nbsp(zwnj2nb3nnb4) + nbsp:zwnj3zwj4 = +nbsp(zwnj3zwj4) + japan:nicola_f_bs = +jp(nicola_f_bs) + japan:hztg_escape = +jp(hztg_escape) + korean:ralt_hangul = +kr(ralt_hangul) + korean:rctrl_hangul = +kr(rctrl_hangul) + korean:ralt_hanja = +kr(ralt_hanja) + korean:rctrl_hanja = +kr(rctrl_hanja) + kpdl:dot = +kpdl(dot) + kpdl:comma = +kpdl(comma) + kpdl:dotoss = +kpdl(dotoss) + kpdl:dotoss_latin9 = +kpdl(dotoss_latin9) + kpdl:commaoss = +kpdl(commaoss) + kpdl:momayyezoss = +kpdl(momayyezoss) + kpdl:kposs = +kpdl(kposs) + kpdl:semi = +kpdl(semi) + shift:breaks_caps = +shift(breaks_caps) + esperanto:qwerty = +epo(qwerty) + esperanto:dvorak = +epo(dvorak) + esperanto:colemak = +epo(colemak) + terminate:ctrl_alt_bksp = +terminate(ctrl_alt_bksp) + keypad:pointerkeys = +keypad(pointerkeys) + apple:alupckeys = +macintosh_vndr/apple(alupckeys) + shift:both_capslock = +shift(both_capslock) + shift:lshift_both_capslock = +shift(lshift_both_capslock) + shift:rshift_both_capslock = +shift(rshift_both_capslock) + shift:both_capslock_cancel = +shift(both_capslock_cancel) + shift:lshift_both_capslock_cancel = +shift(lshift_both_capslock_cancel) + shift:rshift_both_capslock_cancel = +shift(rshift_both_capslock_cancel) + shift:both_shiftlock = +shift(both_shiftlock) + shift:lshift_both_shiftlock = +shift(lshift_both_shiftlock) + shift:rshift_both_shiftlock = +shift(rshift_both_shiftlock) + solaris:sun_compat = +sun_vndr/solaris(sun_compat) + lv3:caps_switch = +level3(caps_switch) + lv3:bksl_switch = +level3(bksl_switch) + lv3:lsgt_switch = +level3(lsgt_switch) + lv3:caps_switch_latch = +level3(caps_switch_latch) + lv3:bksl_switch_latch = +level3(bksl_switch_latch) + lv3:lsgt_switch_latch = +level3(lsgt_switch_latch) + lv5:lsgt_switch = +level5(lsgt_switch) + lv5:ralt_switch = +level5(ralt_switch) + lv5:lsgt_switch_lock = +level5(lsgt_switch_lock) + lv5:ralt_switch_lock = +level5(ralt_switch_lock) + lv5:lwin_switch_lock = +level5(lwin_switch_lock) + lv5:rwin_switch_lock = +level5(rwin_switch_lock) + lv5:lsgt_switch_lock_cancel = +level5(lsgt_switch_lock_cancel) + lv5:ralt_switch_lock_cancel = +level5(ralt_switch_lock_cancel) + lv5:lwin_switch_lock_cancel = +level5(lwin_switch_lock_cancel) + lv5:rwin_switch_lock_cancel = +level5(rwin_switch_lock_cancel) + parens:swap_brackets = +parens(swap_brackets) + misc:typo = +typo(base):all + + +! option = compat + grp_led:num = +lednum(group_lock) + grp_led:caps = +ledcaps(group_lock) + grp_led:scroll = +ledscroll(group_lock) + mod_led:compose = +ledcompose(compose) + japan:kana_lock = +japan(kana_lock) + caps:shiftlock = +ledcaps(shift_lock) + grab:break_actions = +xfree86(grab_break) + + +! option = types + caps:internal = +caps(internal) + caps:internal_nocancel = +caps(internal_nocancel) + caps:shift = +caps(shift) + caps:shift_nocancel = +caps(shift_nocancel) + numpad:pc = +numpad(pc) + numpad:mac = +numpad(mac) + numpad:microsoft = +numpad(microsoft) + numpad:shift3 = +numpad(shift3) diff --git a/test_files/compile-include/rules/extended-wild-cards b/test_files/compile-include/rules/extended-wild-cards new file mode 100644 index 00000000..d7709376 --- /dev/null +++ b/test_files/compile-include/rules/extended-wild-cards @@ -0,0 +1,23 @@ +! model = keycodes + * = evdev + +! model = compat + * = complete + +! model = types + * = complete + +! model = symbols + * = pc + +! layout[any] variant[any] = symbols + l1 = +l10:%i // compatibity mapping: l1, no variant + l1 v1 = +l20:%i // compatibity mapping: l1, specific variant + l1 = +l30%(v[%i]):%i // compatibity mapping: l1, some variant + l2 * = +l40%(v[%i]):%i // compatibity mapping: l2, some variant (legacy) + l3 = +l50%(v[%i]):%i // compatibity mapping: l3, any variant (catch-all) + * v2 = +%l[%i](v20):%i // compatibity mapping: specific variant + * = +%l[%i]%(v[%i]):%i // catch-all + +! option = symbols + opt1 = +opt1 diff --git a/test_files/compile-include/rules/special_indexes b/test_files/compile-include/rules/special_indexes new file mode 100644 index 00000000..478e274b --- /dev/null +++ b/test_files/compile-include/rules/special_indexes @@ -0,0 +1,58 @@ +! model = keycodes + my_model = my_keycodes + * = default_keycodes + +! layout[single] variant = symbols // valid + layout_a my_variant = symbols_a+extra_variant + +! layout[single] = symbols + layout_a = symbols_A + +! layout = symbols + layout_b = symbols_B + layout_c = symbols_C:%i // valid, but unusual + layout_d = symbols_D + layout_e = symbols_E + * = %l[%i]%(v[%i]) // valid, but unusual + +! layout[first] = symbols + layout_a = symbols_a:1 + layout_b = symbols_b:1 + layout_c = symbols_c:1 + layout_d = symbols_d:%i // valid, but unusual + layout_e = symbols_e:1 + * = %l[%i]%(v[%i]) // valid, cannot be easily expressed otherwise + +! layout[first] = symbols + layout_e = %+l // different output if single or multiple layouts + +! layout[later] = symbols + layout_a = +symbols_x:%i + layout_b = +symbols_y:%i + * = +%l[%i]%(v[%i]):%i + +! layout[any] = symbols + layout_c = +symbols_z:%i + +! layout[any] variant[any] = symbols + * extra = +foo:%i|bar:%i + +! layout[1] variant = symbols // invalid mapping + * * = +symbols_AAA:%i + +! layout variant[1] = symbols // invalid mapping + * * = +symbols_BBB:%i + +! layout[1] variant[2] = symbols // invalid mapping + * * = +symbols_CCC:%i + +! model = types + my_model = my_types + * = default_types + +! model = compat + my_model = my_compat + * = default_compat + +! option = symbols + my_option = +extra_option diff --git a/test_files/compile-include/rules/wildcard b/test_files/compile-include/rules/wildcard new file mode 100644 index 00000000..6074cd5f --- /dev/null +++ b/test_files/compile-include/rules/wildcard @@ -0,0 +1,32 @@ +! model = keycodes + * = evdev + +! model = geometry + * = pc(pc104) + +! layout variant = symbols + * * = pc+%l%(v) + +! layout[1] variant[1] = symbols + * * = pc+%l[1]%(v[1]) + +! layout[2] variant[2] = symbols + * * = +%l[2]%(v[2]):2 + +! layout[3] variant[3] = symbols + * * = +%l[3]%(v[3]):3 + +! layout[4] variant[3] = symbols + * * = +%l[4]%(v[4]):4 + +! model layout = compat + * * = complete + +! model layout[1] = compat + * * = complete + +! model layout[2] = compat + * * = complete + +! model = types + * = complete diff --git a/test_files/compile-include/rules/x b/test_files/compile-include/rules/x new file mode 100644 index 00000000..0f7e77d8 --- /dev/null +++ b/test_files/compile-include/rules/x @@ -0,0 +1,2 @@ +! model = symbols + a = b diff --git a/test_files/compile-include/symbols/merge_modes b/test_files/compile-include/symbols/merge_modes new file mode 100644 index 00000000..0ff12a79 --- /dev/null +++ b/test_files/compile-include/symbols/merge_modes @@ -0,0 +1,902 @@ +// WARNING: This file was auto-generated by: scripts/update-symbols-tests.py +xkb_symbols "base" { + key { }; + key { }; + key { }; + key { }; + key { }; + key { }; + key { symbols=[a] }; + key { actions=[SetGroup(group=2)] }; + key { symbols=[a], actions=[SetGroup(group=2)] }; + key { symbols=[a] }; + key { actions=[SetGroup(group=2)] }; + key { symbols=[a], actions=[SetGroup(group=2)] }; + key { symbols=[a, {A, Y}] }; + key { actions=[SetGroup(group=2), {SetGroup(group=2), SetMods(mods=Control)}] }; + key { symbols=[a, {A, Y}], actions=[SetGroup(group=2), {SetGroup(group=2), SetMods(mods=Control)}] }; + key { actions=[NoAction(), SetGroup(group=2)] }; + key { symbols=[NoSymbol, A], actions=[NoAction(), SetGroup(group=2)] }; + key { symbols=[NoSymbol, A] }; + key { actions=[NoAction(), SetGroup(group=2)] }; + key { symbols=[NoSymbol, A], actions=[NoAction(), SetGroup(group=2)] }; + key { actions=[NoAction(), SetGroup(group=2), NoAction()] }; + key { symbols=[NoSymbol, A, NoSymbol], actions=[NoAction(), SetGroup(group=2), NoAction()] }; + key { symbols=[NoSymbol, A, NoSymbol] }; + key { symbols=[a, A] }; + key { actions=[SetGroup(group=2), SetGroup(group=2)] }; + key { symbols=[a, A], actions=[SetGroup(group=2), SetGroup(group=2)] }; + key { symbols=[a, A, a] }; + key { actions=[SetGroup(group=2), SetGroup(group=2), SetGroup(group=2)] }; + key { symbols=[a, A, a], actions=[SetGroup(group=2), SetGroup(group=2), SetGroup(group=2)] }; + key { symbols=[NoSymbol, NoSymbol] }; + key { actions=[NoAction(), NoAction()] }; + key { symbols=[NoSymbol, NoSymbol] }; + key { actions=[NoAction(), NoAction()] }; + key { symbols=[NoSymbol, NoSymbol] }; + key { symbols=[NoSymbol, NoSymbol] }; + key { symbols=[NoSymbol, NoSymbol] }; + key { actions=[NoAction(), NoAction()] }; + key { symbols=[NoSymbol, NoSymbol] }; + key { symbols=[NoSymbol, NoSymbol] }; + key { actions=[NoAction(), NoAction()] }; + key { symbols=[NoSymbol, NoSymbol] }; + key { symbols=[a, A] }; + key { actions=[SetGroup(group=2), SetGroup(group=2)] }; + key { symbols=[a, A], actions=[SetGroup(group=2), SetGroup(group=2)] }; + key { actions=[SetGroup(group=2), SetGroup(group=2)] }; + key { symbols=[a, A], actions=[SetGroup(group=2), SetGroup(group=2)] }; + key { symbols=[a, A] }; + key { symbols=[a, A] }; + key { actions=[SetGroup(group=2), SetGroup(group=2)] }; + key { symbols=[a, A], actions=[SetGroup(group=2), SetGroup(group=2)] }; + key { symbols=[a, A] }; + key { actions=[SetGroup(group=2), SetGroup(group=2)] }; + key { symbols=[a, A], actions=[SetGroup(group=2), SetGroup(group=2)] }; + key { symbols=[a, NoSymbol], actions=[NoAction(), SetGroup(group=2)] }; + key { symbols=[NoSymbol, NoSymbol] }; + key { actions=[NoAction(), NoAction()] }; + key { symbols=[NoSymbol, NoSymbol] }; + key { symbols=[NoSymbol, NoSymbol] }; + key { actions=[NoAction(), NoAction()] }; + key { symbols=[NoSymbol, NoSymbol] }; + key { symbols=[NoSymbol, NoSymbol] }; + key { actions=[NoAction(), NoAction()] }; + key { symbols=[NoSymbol, NoSymbol] }; + key { symbols=[NoSymbol, NoSymbol] }; + key { actions=[NoAction(), NoAction()] }; + key { symbols=[NoSymbol, NoSymbol] }; + key { symbols=[NoSymbol, NoSymbol] }; + key { actions=[NoAction(), NoAction()] }; + key { symbols=[NoSymbol, NoSymbol] }; + key { symbols=[NoSymbol, NoSymbol] }; + key { actions=[NoAction(), NoAction()] }; + key { symbols=[NoSymbol, NoSymbol] }; + key { symbols=[a, A] }; + key { actions=[SetGroup(group=2), SetGroup(group=2)] }; + key { symbols=[a, A], actions=[SetGroup(group=2), SetGroup(group=2)] }; + key { symbols=[a, A] }; + key { actions=[SetGroup(group=2), SetGroup(group=2)] }; + key { symbols=[a, A], actions=[SetGroup(group=2), SetGroup(group=2)] }; + key { symbols=[a, A] }; + key { actions=[SetGroup(group=2), SetGroup(group=2)] }; + key { symbols=[a, A], actions=[SetGroup(group=2), SetGroup(group=2)] }; + key { symbols=[a, A] }; + key { actions=[SetGroup(group=2), SetGroup(group=2)] }; + key { symbols=[a, A], actions=[SetGroup(group=2), SetGroup(group=2)] }; + key { symbols=[a, A] }; + key { actions=[SetGroup(group=2), SetGroup(group=2)] }; + key { symbols=[a, A], actions=[SetGroup(group=2), SetGroup(group=2)] }; + key { symbols=[a, A] }; + key { actions=[SetGroup(group=2), SetGroup(group=2)] }; + key { symbols=[a, A], actions=[SetGroup(group=2), SetGroup(group=2)] }; + key { symbols=[{NoSymbol, NoSymbol}, {NoSymbol, NoSymbol}] }; + key { actions=[{NoAction(), NoAction()}, {NoAction(), NoAction()}] }; + key { symbols=[{NoSymbol, NoSymbol}, {NoSymbol, NoSymbol}] }; + key { symbols=[{NoSymbol, NoSymbol}, {NoSymbol, NoSymbol}] }; + key { actions=[{NoAction(), NoAction()}, {NoAction(), NoAction()}] }; + key { symbols=[{NoSymbol, NoSymbol}, {NoSymbol, NoSymbol}] }; + key { symbols=[{NoSymbol, NoSymbol}, {A, Y}] }; + key { actions=[{NoAction(), NoAction()}, {SetGroup(group=2), SetMods(mods=Control)}] }; + key { symbols=[{NoSymbol, NoSymbol}, {A, Y}], actions=[{NoAction(), NoAction()}, {SetGroup(group=2), SetMods(mods=Control)}] }; + key { symbols=[{a, NoSymbol}, {NoSymbol, B}] }; + key { actions=[{SetGroup(group=2), NoAction()}, {NoAction(), SetGroup(group=2)}] }; + key { symbols=[{a, NoSymbol}, {NoSymbol, B}], actions=[{SetGroup(group=2), NoAction()}, {NoAction(), SetGroup(group=2)}] }; + key { symbols=[{a, NoSymbol}, {NoSymbol, B}] }; + key { actions=[{SetGroup(group=2), NoAction()}, {NoAction(), SetGroup(group=2)}] }; + key { symbols=[{a, NoSymbol}, {NoSymbol, B}], actions=[{SetGroup(group=2), NoAction()}, {NoAction(), SetGroup(group=2)}] }; + key { symbols=[{a, y}, {A, Y}] }; + key { actions=[{SetGroup(group=2), SetMods(mods=Control)}, {SetGroup(group=2), SetMods(mods=Control)}] }; + key { symbols=[{a, y}, {A, Y}], actions=[{SetGroup(group=2), SetMods(mods=Control)}, {SetGroup(group=2), SetMods(mods=Control)}] }; + key { symbols=[{a, y}, {X, B}] }; + key { actions=[{SetGroup(group=2), SetMods(mods=Control)}, {SetMods(mods=Control), SetGroup(group=2)}] }; + key { symbols=[{a, y}, {X, B}], actions=[{SetGroup(group=2), SetMods(mods=Control)}, {SetMods(mods=Control), SetGroup(group=2)}] }; + key { symbols=[{NoSymbol, NoSymbol}, {NoSymbol, NoSymbol, NoSymbol}] }; + key { actions=[{NoAction(), NoAction()}, {NoAction(), NoAction(), NoAction()}] }; + key { symbols=[{NoSymbol, NoSymbol}, {NoSymbol, NoSymbol, NoSymbol}] }; + key { symbols=[{NoSymbol, NoSymbol}, {NoSymbol, NoSymbol, NoSymbol}] }; + key { actions=[{NoAction(), NoAction()}, {NoAction(), NoAction(), NoAction()}] }; + key { symbols=[{NoSymbol, NoSymbol}, {NoSymbol, NoSymbol, NoSymbol}] }; + key { symbols=[{a, y}, {X, NoSymbol, A}] }; + key { actions=[{SetGroup(group=2), SetMods(mods=Control)}, {SetMods(mods=Control), NoAction(), SetGroup(group=2)}] }; + key { symbols=[{a, y}, {X, NoSymbol, A}], actions=[{SetGroup(group=2), SetMods(mods=Control)}, {SetMods(mods=Control), NoAction(), SetGroup(group=2)}] }; + key { symbols=[{a, y}, {X, NoSymbol, A}] }; + key { actions=[{SetGroup(group=2), SetMods(mods=Control)}, {SetMods(mods=Control), NoAction(), SetGroup(group=2)}] }; + key { symbols=[{a, y}, {X, NoSymbol, A}], actions=[{SetGroup(group=2), SetMods(mods=Control)}, {SetMods(mods=Control), NoAction(), SetGroup(group=2)}] }; + key { symbols=[{NoSymbol, NoSymbol}, {A, Y}] }; + key { actions=[{NoAction(), NoAction()}, {SetGroup(group=2), SetMods(mods=Control)}] }; + key { symbols=[{NoSymbol, NoSymbol}, {A, Y}], actions=[{NoAction(), NoAction()}, {SetGroup(group=2), SetMods(mods=Control)}] }; + key { symbols=[{NoSymbol, NoSymbol}, {A, Y}] }; + key { actions=[{NoAction(), NoAction()}, {SetGroup(group=2), SetMods(mods=Control)}] }; + key { symbols=[{NoSymbol, NoSymbol}, {A, Y}], actions=[{NoAction(), NoAction()}, {SetGroup(group=2), SetMods(mods=Control)}] }; + key { symbols=[{a, NoSymbol}, {NoSymbol, B}] }; + key { actions=[{SetGroup(group=2), NoAction()}, {NoAction(), SetGroup(group=2)}] }; + key { symbols=[{a, NoSymbol}, {NoSymbol, B}], actions=[{SetGroup(group=2), NoAction()}, {NoAction(), SetGroup(group=2)}] }; + key { symbols=[{a, NoSymbol}, {NoSymbol, B}] }; + key { actions=[{SetGroup(group=2), NoAction()}, {NoAction(), SetGroup(group=2)}] }; + key { symbols=[{a, NoSymbol}, {NoSymbol, B}], actions=[{SetGroup(group=2), NoAction()}, {NoAction(), SetGroup(group=2)}] }; + key { actions=[SetGroup(group=2)] }; + key { actions=[{SetGroup(group=2), SetMods(mods=Control)}] }; + key { actions=[SetGroup(group=2), {SetGroup(group=2), SetMods(mods=Control)}] }; + key { symbols=[a, NoSymbol], actions=[NoAction(), SetGroup(group=2)] }; + key { symbols=[{a, b}, NoSymbol], actions=[NoAction(), {SetGroup(group=2), SetMods(mods=Control)}] }; + key { symbols=[{a, b}, NoSymbol], actions=[NoAction(), {SetGroup(group=2), SetMods(mods=Control)}] }; + key { symbols=[{a, NoSymbol}, NoSymbol], actions=[NoAction(), {SetGroup(group=2), NoAction()}] }; + key { symbols=[{a, b}, NoSymbol], actions=[NoAction(), {SetGroup(group=2), SetMods(mods=Control)}] }; + key { symbols=[{a, b}, {A, B}], actions=[{SetGroup(group=2), SetMods(mods=Control)}, {SetGroup(group=2), SetMods(mods=Control)}] }; + key { symbols=[{a, NoSymbol}, {A, B}], actions=[{SetGroup(group=2), SetMods(mods=Control)}, {SetGroup(group=2), NoAction()}] }; + key { symbols=[{a, b}, {NoSymbol, B}], actions=[{SetGroup(group=2), SetMods(mods=Control)}, {SetGroup(group=2), NoAction()}] }; + key { symbols=[{a, NoSymbol}, {NoSymbol, B}], actions=[{SetGroup(group=2), NoAction()}, {NoAction(), SetMods(mods=Control)}] }; + key { symbols=[a, {A, B}] }; + key { actions=[SetGroup(group=3), {SetGroup(group=3), SetMods(mods=Mod5)}] }; + key { symbols=[a, {A, B}], actions=[SetGroup(group=2), {SetGroup(group=2), SetMods(mods=Control)}] }; + key { symbols=[A] }; +}; + +xkb_symbols "new-default" { + include "merge_modes(base)" + + ////// Trivial cases ////// + key { }; + key { }; + key { }; + key { symbols=[Greek_alpha] }; + key { actions=[SetGroup(group=3)] }; + key { symbols=[Greek_alpha], actions=[SetGroup(group=3)] }; + key { }; + key { }; + key { }; + + ////// Same key ////// + key { symbols=[a] }; + key { actions=[SetGroup(group=2)] }; + key { symbols=[a], actions=[SetGroup(group=2)] }; + key { symbols=[a, {A, Y}] }; + key { actions=[SetGroup(group=2), {SetGroup(group=2), SetMods(mods=Control)}] }; + key { symbols=[a, {A, Y}], actions=[SetGroup(group=2), {SetGroup(group=2), SetMods(mods=Control)}] }; + + ////// Mismatch levels count ////// + key { actions=[SetGroup(group=3), NoAction(), NoAction()] }; + key { symbols=[Greek_alpha, NoSymbol, NoSymbol], actions=[SetGroup(group=3), NoAction(), NoAction()] }; + key { symbols=[Greek_alpha, NoSymbol, NoSymbol] }; + key { actions=[SetGroup(group=3), NoAction(), NoAction()] }; + key { symbols=[Greek_alpha, NoSymbol, NoSymbol], actions=[SetGroup(group=3), NoAction(), NoAction()] }; + key { actions=[SetGroup(group=3), NoAction()] }; + key { symbols=[Greek_alpha, NoSymbol], actions=[SetGroup(group=3), NoAction()] }; + key { symbols=[Greek_alpha, NoSymbol] }; + key { symbols=[Greek_alpha, Greek_ALPHA, Greek_alpha] }; + key { actions=[SetGroup(group=3), SetGroup(group=3), SetGroup(group=3)] }; + key { symbols=[Greek_alpha, Greek_ALPHA, Greek_alpha], actions=[SetGroup(group=3), SetGroup(group=3), SetGroup(group=3)] }; + key { symbols=[Greek_alpha, Greek_ALPHA] }; + key { actions=[SetGroup(group=3), SetGroup(group=3)] }; + key { symbols=[Greek_alpha, Greek_ALPHA], actions=[SetGroup(group=3), SetGroup(group=3)] }; + + ////// Single keysyms -> single keysyms ////// + key { symbols=[NoSymbol, NoSymbol] }; + key { actions=[NoAction(), NoAction()] }; + key { symbols=[NoSymbol, NoSymbol] }; + key { actions=[SetGroup(group=3), NoAction()] }; + key { symbols=[Greek_alpha, NoSymbol], actions=[SetGroup(group=3), NoAction()] }; + key { symbols=[Greek_alpha, NoSymbol] }; + key { symbols=[NoSymbol, Greek_ALPHA] }; + key { actions=[NoAction(), SetGroup(group=3)] }; + key { symbols=[NoSymbol, Greek_ALPHA], actions=[NoAction(), SetGroup(group=3)] }; + key { symbols=[Greek_alpha, Greek_ALPHA] }; + key { actions=[SetGroup(group=3), SetGroup(group=3)] }; + key { symbols=[Greek_alpha, Greek_ALPHA], actions=[SetGroup(group=3), SetGroup(group=3)] }; + key { symbols=[NoSymbol, NoSymbol] }; + key { actions=[NoAction(), NoAction()] }; + key { symbols=[NoSymbol, NoSymbol] }; + key { actions=[SetGroup(group=3), NoAction()] }; + key { symbols=[Greek_alpha, NoSymbol], actions=[SetGroup(group=3), NoAction()] }; + key { symbols=[Greek_alpha, NoSymbol] }; + key { symbols=[NoSymbol, Greek_ALPHA] }; + key { actions=[NoAction(), SetGroup(group=3)] }; + key { symbols=[NoSymbol, Greek_ALPHA], actions=[NoAction(), SetGroup(group=3)] }; + key { symbols=[Greek_alpha, Greek_ALPHA] }; + key { actions=[SetGroup(group=3), SetGroup(group=3)] }; + key { symbols=[Greek_alpha, Greek_ALPHA], actions=[SetGroup(group=3), SetGroup(group=3)] }; + key { symbols=[NoSymbol, X], actions=[SetGroup(group=3), NoAction()] }; + + ////// Single keysyms -> multiple keysyms ////// + key { symbols=[{Greek_alpha, NoSymbol}, NoSymbol] }; + key { actions=[{SetGroup(group=3), NoAction()}, NoAction()] }; + key { symbols=[{Greek_alpha, NoSymbol}, NoSymbol], actions=[{SetGroup(group=3), NoAction()}, NoAction()] }; + key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, NoSymbol}] }; + key { actions=[{SetGroup(group=3), NoAction()}, {NoAction(), NoAction()}] }; + key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, NoSymbol}], actions=[{SetGroup(group=3), NoAction()}, {NoAction(), NoAction()}] }; + key { symbols=[NoSymbol, {Greek_ALPHA, NoSymbol}] }; + key { actions=[NoAction(), {SetGroup(group=3), NoAction()}] }; + key { symbols=[NoSymbol, {Greek_ALPHA, NoSymbol}], actions=[NoAction(), {SetGroup(group=3), NoAction()}] }; + key { symbols=[{NoSymbol, NoSymbol}, {Greek_ALPHA, NoSymbol}] }; + key { actions=[{NoAction(), NoAction()}, {SetGroup(group=3), NoAction()}] }; + key { symbols=[{NoSymbol, NoSymbol}, {Greek_ALPHA, NoSymbol}], actions=[{NoAction(), NoAction()}, {SetGroup(group=3), NoAction()}] }; + key { symbols=[{Greek_alpha, NoSymbol}, {Greek_ALPHA, NoSymbol}] }; + key { actions=[{SetGroup(group=3), NoAction()}, {SetGroup(group=3), NoAction()}] }; + key { symbols=[{Greek_alpha, NoSymbol}, {Greek_ALPHA, NoSymbol}], actions=[{SetGroup(group=3), NoAction()}, {SetGroup(group=3), NoAction()}] }; + key { symbols=[{Greek_alpha, Greek_upsilon}, {Greek_ALPHA, Greek_UPSILON}] }; + key { actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + key { symbols=[{Greek_alpha, Greek_upsilon}, {Greek_ALPHA, Greek_UPSILON}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + key { symbols=[{Greek_alpha, NoSymbol}, NoSymbol] }; + key { actions=[{SetGroup(group=3), NoAction()}, NoAction()] }; + key { symbols=[{Greek_alpha, NoSymbol}, NoSymbol], actions=[{SetGroup(group=3), NoAction()}, NoAction()] }; + key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, NoSymbol}] }; + key { actions=[{SetGroup(group=3), NoAction()}, {NoAction(), NoAction()}] }; + key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, NoSymbol}], actions=[{SetGroup(group=3), NoAction()}, {NoAction(), NoAction()}] }; + key { symbols=[NoSymbol, {Greek_ALPHA, NoSymbol}] }; + key { actions=[NoAction(), {SetGroup(group=3), NoAction()}] }; + key { symbols=[NoSymbol, {Greek_ALPHA, NoSymbol}], actions=[NoAction(), {SetGroup(group=3), NoAction()}] }; + key { symbols=[{NoSymbol, NoSymbol}, {Greek_ALPHA, NoSymbol}] }; + key { actions=[{NoAction(), NoAction()}, {SetGroup(group=3), NoAction()}] }; + key { symbols=[{NoSymbol, NoSymbol}, {Greek_ALPHA, NoSymbol}], actions=[{NoAction(), NoAction()}, {SetGroup(group=3), NoAction()}] }; + key { symbols=[{Greek_alpha, NoSymbol}, {Greek_ALPHA, NoSymbol}] }; + key { actions=[{SetGroup(group=3), NoAction()}, {SetGroup(group=3), NoAction()}] }; + key { symbols=[{Greek_alpha, NoSymbol}, {Greek_ALPHA, NoSymbol}], actions=[{SetGroup(group=3), NoAction()}, {SetGroup(group=3), NoAction()}] }; + key { symbols=[{Greek_alpha, Greek_upsilon}, {Greek_ALPHA, Greek_UPSILON}] }; + key { actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + key { symbols=[{Greek_alpha, Greek_upsilon}, {Greek_ALPHA, Greek_UPSILON}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + + ////// Multiple keysyms -> multiple keysyms ////// + key { symbols=[{NoSymbol, NoSymbol}, {Greek_ALPHA, Greek_UPSILON}] }; + key { actions=[{NoAction(), NoAction()}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + key { symbols=[{NoSymbol, NoSymbol}, {Greek_ALPHA, Greek_UPSILON}], actions=[{NoAction(), NoAction()}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, Greek_BETA}] }; + key { actions=[{SetGroup(group=3), NoAction()}, {NoAction(), SetGroup(group=3)}] }; + key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, Greek_BETA}], actions=[{SetGroup(group=3), NoAction()}, {NoAction(), SetGroup(group=3)}] }; + key { symbols=[{Greek_alpha, Greek_upsilon}, {Greek_ALPHA, Greek_UPSILON}] }; + key { actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + key { symbols=[{Greek_alpha, Greek_upsilon}, {Greek_ALPHA, Greek_UPSILON}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, Greek_BETA}] }; + key { actions=[{SetGroup(group=3), NoAction()}, {NoAction(), SetGroup(group=3)}] }; + key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, Greek_BETA}], actions=[{SetGroup(group=3), NoAction()}, {NoAction(), SetGroup(group=3)}] }; + key { symbols=[{Greek_alpha, Greek_upsilon}, {Greek_XI, Greek_BETA}] }; + key { actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetMods(mods=Mod5), SetGroup(group=3)}] }; + key { symbols=[{Greek_alpha, Greek_upsilon}, {Greek_XI, Greek_BETA}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetMods(mods=Mod5), SetGroup(group=3)}] }; + key { symbols=[{NoSymbol, NoSymbol}, {Greek_ALPHA, Greek_UPSILON}] }; + key { actions=[{NoAction(), NoAction()}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + key { symbols=[{NoSymbol, NoSymbol}, {Greek_ALPHA, Greek_UPSILON}], actions=[{NoAction(), NoAction()}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, Greek_BETA}] }; + key { actions=[{SetGroup(group=3), NoAction()}, {NoAction(), SetGroup(group=3)}] }; + key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, Greek_BETA}], actions=[{SetGroup(group=3), NoAction()}, {NoAction(), SetGroup(group=3)}] }; + key { symbols=[{NoSymbol, NoSymbol, NoSymbol}, {NoSymbol, NoSymbol}] }; + key { actions=[{NoAction(), NoAction(), NoAction()}, {NoAction(), NoAction()}] }; + key { symbols=[{NoSymbol, NoSymbol, NoSymbol}, {NoSymbol, NoSymbol}] }; + key { symbols=[{Greek_alpha, NoSymbol, Greek_xi}, {Greek_XI, Greek_BETA}] }; + key { actions=[{SetGroup(group=3), NoAction(), SetMods(mods=Mod5)}, {SetMods(mods=Mod5), SetGroup(group=3)}] }; + key { symbols=[{Greek_alpha, NoSymbol, Greek_xi}, {Greek_XI, Greek_BETA}], actions=[{SetGroup(group=3), NoAction(), SetMods(mods=Mod5)}, {SetMods(mods=Mod5), SetGroup(group=3)}] }; + key { symbols=[{NoSymbol, NoSymbol, NoSymbol}, {NoSymbol, NoSymbol}] }; + key { actions=[{NoAction(), NoAction(), NoAction()}, {NoAction(), NoAction()}] }; + key { symbols=[{NoSymbol, NoSymbol, NoSymbol}, {NoSymbol, NoSymbol}] }; + key { symbols=[{Greek_alpha, NoSymbol, Greek_xi}, {Greek_XI, Greek_BETA}] }; + key { actions=[{SetGroup(group=3), NoAction(), SetMods(mods=Mod5)}, {SetMods(mods=Mod5), SetGroup(group=3)}] }; + key { symbols=[{Greek_alpha, NoSymbol, Greek_xi}, {Greek_XI, Greek_BETA}], actions=[{SetGroup(group=3), NoAction(), SetMods(mods=Mod5)}, {SetMods(mods=Mod5), SetGroup(group=3)}] }; + + ////// Multiple keysyms -> single keysyms ////// + key { symbols=[NoSymbol, NoSymbol] }; + key { actions=[NoAction(), NoAction()] }; + key { symbols=[NoSymbol, NoSymbol] }; + key { symbols=[Greek_alpha, Greek_ALPHA] }; + key { actions=[SetGroup(group=3), SetGroup(group=3)] }; + key { symbols=[Greek_alpha, Greek_ALPHA], actions=[SetGroup(group=3), SetGroup(group=3)] }; + key { symbols=[NoSymbol, NoSymbol] }; + key { actions=[NoAction(), NoAction()] }; + key { symbols=[NoSymbol, NoSymbol] }; + key { symbols=[Greek_alpha, Greek_ALPHA] }; + key { actions=[SetGroup(group=3), SetGroup(group=3)] }; + key { symbols=[Greek_alpha, Greek_ALPHA], actions=[SetGroup(group=3), SetGroup(group=3)] }; + + ////// Mix ////// + key { actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + key { actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, SetGroup(group=3)] }; + key { actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, SetGroup(group=3)] }; + + ////// Mix ////// + key { symbols=[NoSymbol, {X, Y}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, NoAction()] }; + + ////// Multiple keysyms/actions –> single ////// + key { symbols=[NoSymbol, X], actions=[SetGroup(group=3), NoAction()] }; + + ////// Multiple keysyms/actions –> multiple (xor) ////// + key { symbols=[NoSymbol, {X, Y}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, NoAction()] }; + + ////// Multiple keysyms/actions –> multiple (mix) ////// + key { symbols=[{x, y}, {X, Y}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + key { symbols=[{x, NoSymbol}, {X, Y}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), NoAction()}] }; + + ////// Multiple (mix) –> multiple keysyms/actions ////// + key { symbols=[{x, NoSymbol}, NoSymbol], actions=[NoAction(), {SetGroup(group=3), NoAction()}] }; + key { symbols=[{x, y}, NoSymbol], actions=[NoAction(), {SetGroup(group=3), SetMods(mods=Mod5)}] }; + + ////// Multiple (mix) –> multiple (mix) ////// + key { symbols=[{NoSymbol, y}, {X, Y}], actions=[{SetGroup(group=3), NoAction()}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + key { symbols=[{NoSymbol, y}, {X, NoSymbol}], actions=[{NoAction(), SetMods(mods=Mod5)}, {SetGroup(group=3), NoAction()}] }; + + ////// Mismatch count with mix ////// + key { actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, SetGroup(group=3)] }; + key { symbols=[{A, B}, a] }; + key { symbols=[{x, y}, X], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, SetGroup(group=3)] }; + + ////// Issue #564 ////// + key { symbols=[{A, A}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}] }; +}; + +xkb_symbols "new-augment" { + include "merge_modes(base)" + + ////// Trivial cases ////// + augment key { }; + augment key { }; + augment key { }; + augment key { symbols=[Greek_alpha] }; + augment key { actions=[SetGroup(group=3)] }; + augment key { symbols=[Greek_alpha], actions=[SetGroup(group=3)] }; + augment key { }; + augment key { }; + augment key { }; + + ////// Same key ////// + augment key { symbols=[a] }; + augment key { actions=[SetGroup(group=2)] }; + augment key { symbols=[a], actions=[SetGroup(group=2)] }; + augment key { symbols=[a, {A, Y}] }; + augment key { actions=[SetGroup(group=2), {SetGroup(group=2), SetMods(mods=Control)}] }; + augment key { symbols=[a, {A, Y}], actions=[SetGroup(group=2), {SetGroup(group=2), SetMods(mods=Control)}] }; + + ////// Mismatch levels count ////// + augment key { actions=[SetGroup(group=3), NoAction(), NoAction()] }; + augment key { symbols=[Greek_alpha, NoSymbol, NoSymbol], actions=[SetGroup(group=3), NoAction(), NoAction()] }; + augment key { symbols=[Greek_alpha, NoSymbol, NoSymbol] }; + augment key { actions=[SetGroup(group=3), NoAction(), NoAction()] }; + augment key { symbols=[Greek_alpha, NoSymbol, NoSymbol], actions=[SetGroup(group=3), NoAction(), NoAction()] }; + augment key { actions=[SetGroup(group=3), NoAction()] }; + augment key { symbols=[Greek_alpha, NoSymbol], actions=[SetGroup(group=3), NoAction()] }; + augment key { symbols=[Greek_alpha, NoSymbol] }; + augment key { symbols=[Greek_alpha, Greek_ALPHA, Greek_alpha] }; + augment key { actions=[SetGroup(group=3), SetGroup(group=3), SetGroup(group=3)] }; + augment key { symbols=[Greek_alpha, Greek_ALPHA, Greek_alpha], actions=[SetGroup(group=3), SetGroup(group=3), SetGroup(group=3)] }; + augment key { symbols=[Greek_alpha, Greek_ALPHA] }; + augment key { actions=[SetGroup(group=3), SetGroup(group=3)] }; + augment key { symbols=[Greek_alpha, Greek_ALPHA], actions=[SetGroup(group=3), SetGroup(group=3)] }; + + ////// Single keysyms -> single keysyms ////// + augment key { symbols=[NoSymbol, NoSymbol] }; + augment key { actions=[NoAction(), NoAction()] }; + augment key { symbols=[NoSymbol, NoSymbol] }; + augment key { actions=[SetGroup(group=3), NoAction()] }; + augment key { symbols=[Greek_alpha, NoSymbol], actions=[SetGroup(group=3), NoAction()] }; + augment key { symbols=[Greek_alpha, NoSymbol] }; + augment key { symbols=[NoSymbol, Greek_ALPHA] }; + augment key { actions=[NoAction(), SetGroup(group=3)] }; + augment key { symbols=[NoSymbol, Greek_ALPHA], actions=[NoAction(), SetGroup(group=3)] }; + augment key { symbols=[Greek_alpha, Greek_ALPHA] }; + augment key { actions=[SetGroup(group=3), SetGroup(group=3)] }; + augment key { symbols=[Greek_alpha, Greek_ALPHA], actions=[SetGroup(group=3), SetGroup(group=3)] }; + augment key { symbols=[NoSymbol, NoSymbol] }; + augment key { actions=[NoAction(), NoAction()] }; + augment key { symbols=[NoSymbol, NoSymbol] }; + augment key { actions=[SetGroup(group=3), NoAction()] }; + augment key { symbols=[Greek_alpha, NoSymbol], actions=[SetGroup(group=3), NoAction()] }; + augment key { symbols=[Greek_alpha, NoSymbol] }; + augment key { symbols=[NoSymbol, Greek_ALPHA] }; + augment key { actions=[NoAction(), SetGroup(group=3)] }; + augment key { symbols=[NoSymbol, Greek_ALPHA], actions=[NoAction(), SetGroup(group=3)] }; + augment key { symbols=[Greek_alpha, Greek_ALPHA] }; + augment key { actions=[SetGroup(group=3), SetGroup(group=3)] }; + augment key { symbols=[Greek_alpha, Greek_ALPHA], actions=[SetGroup(group=3), SetGroup(group=3)] }; + augment key { symbols=[NoSymbol, X], actions=[SetGroup(group=3), NoAction()] }; + + ////// Single keysyms -> multiple keysyms ////// + augment key { symbols=[{Greek_alpha, NoSymbol}, NoSymbol] }; + augment key { actions=[{SetGroup(group=3), NoAction()}, NoAction()] }; + augment key { symbols=[{Greek_alpha, NoSymbol}, NoSymbol], actions=[{SetGroup(group=3), NoAction()}, NoAction()] }; + augment key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, NoSymbol}] }; + augment key { actions=[{SetGroup(group=3), NoAction()}, {NoAction(), NoAction()}] }; + augment key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, NoSymbol}], actions=[{SetGroup(group=3), NoAction()}, {NoAction(), NoAction()}] }; + augment key { symbols=[NoSymbol, {Greek_ALPHA, NoSymbol}] }; + augment key { actions=[NoAction(), {SetGroup(group=3), NoAction()}] }; + augment key { symbols=[NoSymbol, {Greek_ALPHA, NoSymbol}], actions=[NoAction(), {SetGroup(group=3), NoAction()}] }; + augment key { symbols=[{NoSymbol, NoSymbol}, {Greek_ALPHA, NoSymbol}] }; + augment key { actions=[{NoAction(), NoAction()}, {SetGroup(group=3), NoAction()}] }; + augment key { symbols=[{NoSymbol, NoSymbol}, {Greek_ALPHA, NoSymbol}], actions=[{NoAction(), NoAction()}, {SetGroup(group=3), NoAction()}] }; + augment key { symbols=[{Greek_alpha, NoSymbol}, {Greek_ALPHA, NoSymbol}] }; + augment key { actions=[{SetGroup(group=3), NoAction()}, {SetGroup(group=3), NoAction()}] }; + augment key { symbols=[{Greek_alpha, NoSymbol}, {Greek_ALPHA, NoSymbol}], actions=[{SetGroup(group=3), NoAction()}, {SetGroup(group=3), NoAction()}] }; + augment key { symbols=[{Greek_alpha, Greek_upsilon}, {Greek_ALPHA, Greek_UPSILON}] }; + augment key { actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + augment key { symbols=[{Greek_alpha, Greek_upsilon}, {Greek_ALPHA, Greek_UPSILON}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + augment key { symbols=[{Greek_alpha, NoSymbol}, NoSymbol] }; + augment key { actions=[{SetGroup(group=3), NoAction()}, NoAction()] }; + augment key { symbols=[{Greek_alpha, NoSymbol}, NoSymbol], actions=[{SetGroup(group=3), NoAction()}, NoAction()] }; + augment key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, NoSymbol}] }; + augment key { actions=[{SetGroup(group=3), NoAction()}, {NoAction(), NoAction()}] }; + augment key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, NoSymbol}], actions=[{SetGroup(group=3), NoAction()}, {NoAction(), NoAction()}] }; + augment key { symbols=[NoSymbol, {Greek_ALPHA, NoSymbol}] }; + augment key { actions=[NoAction(), {SetGroup(group=3), NoAction()}] }; + augment key { symbols=[NoSymbol, {Greek_ALPHA, NoSymbol}], actions=[NoAction(), {SetGroup(group=3), NoAction()}] }; + augment key { symbols=[{NoSymbol, NoSymbol}, {Greek_ALPHA, NoSymbol}] }; + augment key { actions=[{NoAction(), NoAction()}, {SetGroup(group=3), NoAction()}] }; + augment key { symbols=[{NoSymbol, NoSymbol}, {Greek_ALPHA, NoSymbol}], actions=[{NoAction(), NoAction()}, {SetGroup(group=3), NoAction()}] }; + augment key { symbols=[{Greek_alpha, NoSymbol}, {Greek_ALPHA, NoSymbol}] }; + augment key { actions=[{SetGroup(group=3), NoAction()}, {SetGroup(group=3), NoAction()}] }; + augment key { symbols=[{Greek_alpha, NoSymbol}, {Greek_ALPHA, NoSymbol}], actions=[{SetGroup(group=3), NoAction()}, {SetGroup(group=3), NoAction()}] }; + augment key { symbols=[{Greek_alpha, Greek_upsilon}, {Greek_ALPHA, Greek_UPSILON}] }; + augment key { actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + augment key { symbols=[{Greek_alpha, Greek_upsilon}, {Greek_ALPHA, Greek_UPSILON}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + + ////// Multiple keysyms -> multiple keysyms ////// + augment key { symbols=[{NoSymbol, NoSymbol}, {Greek_ALPHA, Greek_UPSILON}] }; + augment key { actions=[{NoAction(), NoAction()}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + augment key { symbols=[{NoSymbol, NoSymbol}, {Greek_ALPHA, Greek_UPSILON}], actions=[{NoAction(), NoAction()}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + augment key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, Greek_BETA}] }; + augment key { actions=[{SetGroup(group=3), NoAction()}, {NoAction(), SetGroup(group=3)}] }; + augment key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, Greek_BETA}], actions=[{SetGroup(group=3), NoAction()}, {NoAction(), SetGroup(group=3)}] }; + augment key { symbols=[{Greek_alpha, Greek_upsilon}, {Greek_ALPHA, Greek_UPSILON}] }; + augment key { actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + augment key { symbols=[{Greek_alpha, Greek_upsilon}, {Greek_ALPHA, Greek_UPSILON}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + augment key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, Greek_BETA}] }; + augment key { actions=[{SetGroup(group=3), NoAction()}, {NoAction(), SetGroup(group=3)}] }; + augment key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, Greek_BETA}], actions=[{SetGroup(group=3), NoAction()}, {NoAction(), SetGroup(group=3)}] }; + augment key { symbols=[{Greek_alpha, Greek_upsilon}, {Greek_XI, Greek_BETA}] }; + augment key { actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetMods(mods=Mod5), SetGroup(group=3)}] }; + augment key { symbols=[{Greek_alpha, Greek_upsilon}, {Greek_XI, Greek_BETA}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetMods(mods=Mod5), SetGroup(group=3)}] }; + augment key { symbols=[{NoSymbol, NoSymbol}, {Greek_ALPHA, Greek_UPSILON}] }; + augment key { actions=[{NoAction(), NoAction()}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + augment key { symbols=[{NoSymbol, NoSymbol}, {Greek_ALPHA, Greek_UPSILON}], actions=[{NoAction(), NoAction()}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + augment key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, Greek_BETA}] }; + augment key { actions=[{SetGroup(group=3), NoAction()}, {NoAction(), SetGroup(group=3)}] }; + augment key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, Greek_BETA}], actions=[{SetGroup(group=3), NoAction()}, {NoAction(), SetGroup(group=3)}] }; + augment key { symbols=[{NoSymbol, NoSymbol, NoSymbol}, {NoSymbol, NoSymbol}] }; + augment key { actions=[{NoAction(), NoAction(), NoAction()}, {NoAction(), NoAction()}] }; + augment key { symbols=[{NoSymbol, NoSymbol, NoSymbol}, {NoSymbol, NoSymbol}] }; + augment key { symbols=[{Greek_alpha, NoSymbol, Greek_xi}, {Greek_XI, Greek_BETA}] }; + augment key { actions=[{SetGroup(group=3), NoAction(), SetMods(mods=Mod5)}, {SetMods(mods=Mod5), SetGroup(group=3)}] }; + augment key { symbols=[{Greek_alpha, NoSymbol, Greek_xi}, {Greek_XI, Greek_BETA}], actions=[{SetGroup(group=3), NoAction(), SetMods(mods=Mod5)}, {SetMods(mods=Mod5), SetGroup(group=3)}] }; + augment key { symbols=[{NoSymbol, NoSymbol, NoSymbol}, {NoSymbol, NoSymbol}] }; + augment key { actions=[{NoAction(), NoAction(), NoAction()}, {NoAction(), NoAction()}] }; + augment key { symbols=[{NoSymbol, NoSymbol, NoSymbol}, {NoSymbol, NoSymbol}] }; + augment key { symbols=[{Greek_alpha, NoSymbol, Greek_xi}, {Greek_XI, Greek_BETA}] }; + augment key { actions=[{SetGroup(group=3), NoAction(), SetMods(mods=Mod5)}, {SetMods(mods=Mod5), SetGroup(group=3)}] }; + augment key { symbols=[{Greek_alpha, NoSymbol, Greek_xi}, {Greek_XI, Greek_BETA}], actions=[{SetGroup(group=3), NoAction(), SetMods(mods=Mod5)}, {SetMods(mods=Mod5), SetGroup(group=3)}] }; + + ////// Multiple keysyms -> single keysyms ////// + augment key { symbols=[NoSymbol, NoSymbol] }; + augment key { actions=[NoAction(), NoAction()] }; + augment key { symbols=[NoSymbol, NoSymbol] }; + augment key { symbols=[Greek_alpha, Greek_ALPHA] }; + augment key { actions=[SetGroup(group=3), SetGroup(group=3)] }; + augment key { symbols=[Greek_alpha, Greek_ALPHA], actions=[SetGroup(group=3), SetGroup(group=3)] }; + augment key { symbols=[NoSymbol, NoSymbol] }; + augment key { actions=[NoAction(), NoAction()] }; + augment key { symbols=[NoSymbol, NoSymbol] }; + augment key { symbols=[Greek_alpha, Greek_ALPHA] }; + augment key { actions=[SetGroup(group=3), SetGroup(group=3)] }; + augment key { symbols=[Greek_alpha, Greek_ALPHA], actions=[SetGroup(group=3), SetGroup(group=3)] }; + + ////// Mix ////// + augment key { actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + augment key { actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, SetGroup(group=3)] }; + augment key { actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, SetGroup(group=3)] }; + + ////// Mix ////// + augment key { symbols=[NoSymbol, {X, Y}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, NoAction()] }; + + ////// Multiple keysyms/actions –> single ////// + augment key { symbols=[NoSymbol, X], actions=[SetGroup(group=3), NoAction()] }; + + ////// Multiple keysyms/actions –> multiple (xor) ////// + augment key { symbols=[NoSymbol, {X, Y}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, NoAction()] }; + + ////// Multiple keysyms/actions –> multiple (mix) ////// + augment key { symbols=[{x, y}, {X, Y}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + augment key { symbols=[{x, NoSymbol}, {X, Y}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), NoAction()}] }; + + ////// Multiple (mix) –> multiple keysyms/actions ////// + augment key { symbols=[{x, NoSymbol}, NoSymbol], actions=[NoAction(), {SetGroup(group=3), NoAction()}] }; + augment key { symbols=[{x, y}, NoSymbol], actions=[NoAction(), {SetGroup(group=3), SetMods(mods=Mod5)}] }; + + ////// Multiple (mix) –> multiple (mix) ////// + augment key { symbols=[{NoSymbol, y}, {X, Y}], actions=[{SetGroup(group=3), NoAction()}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + augment key { symbols=[{NoSymbol, y}, {X, NoSymbol}], actions=[{NoAction(), SetMods(mods=Mod5)}, {SetGroup(group=3), NoAction()}] }; + + ////// Mismatch count with mix ////// + augment key { actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, SetGroup(group=3)] }; + augment key { symbols=[{A, B}, a] }; + augment key { symbols=[{x, y}, X], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, SetGroup(group=3)] }; + + ////// Issue #564 ////// + augment key { symbols=[{A, A}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}] }; +}; + +xkb_symbols "new-override" { + include "merge_modes(base)" + + ////// Trivial cases ////// + override key { }; + override key { }; + override key { }; + override key { symbols=[Greek_alpha] }; + override key { actions=[SetGroup(group=3)] }; + override key { symbols=[Greek_alpha], actions=[SetGroup(group=3)] }; + override key { }; + override key { }; + override key { }; + + ////// Same key ////// + override key { symbols=[a] }; + override key { actions=[SetGroup(group=2)] }; + override key { symbols=[a], actions=[SetGroup(group=2)] }; + override key { symbols=[a, {A, Y}] }; + override key { actions=[SetGroup(group=2), {SetGroup(group=2), SetMods(mods=Control)}] }; + override key { symbols=[a, {A, Y}], actions=[SetGroup(group=2), {SetGroup(group=2), SetMods(mods=Control)}] }; + + ////// Mismatch levels count ////// + override key { actions=[SetGroup(group=3), NoAction(), NoAction()] }; + override key { symbols=[Greek_alpha, NoSymbol, NoSymbol], actions=[SetGroup(group=3), NoAction(), NoAction()] }; + override key { symbols=[Greek_alpha, NoSymbol, NoSymbol] }; + override key { actions=[SetGroup(group=3), NoAction(), NoAction()] }; + override key { symbols=[Greek_alpha, NoSymbol, NoSymbol], actions=[SetGroup(group=3), NoAction(), NoAction()] }; + override key { actions=[SetGroup(group=3), NoAction()] }; + override key { symbols=[Greek_alpha, NoSymbol], actions=[SetGroup(group=3), NoAction()] }; + override key { symbols=[Greek_alpha, NoSymbol] }; + override key { symbols=[Greek_alpha, Greek_ALPHA, Greek_alpha] }; + override key { actions=[SetGroup(group=3), SetGroup(group=3), SetGroup(group=3)] }; + override key { symbols=[Greek_alpha, Greek_ALPHA, Greek_alpha], actions=[SetGroup(group=3), SetGroup(group=3), SetGroup(group=3)] }; + override key { symbols=[Greek_alpha, Greek_ALPHA] }; + override key { actions=[SetGroup(group=3), SetGroup(group=3)] }; + override key { symbols=[Greek_alpha, Greek_ALPHA], actions=[SetGroup(group=3), SetGroup(group=3)] }; + + ////// Single keysyms -> single keysyms ////// + override key { symbols=[NoSymbol, NoSymbol] }; + override key { actions=[NoAction(), NoAction()] }; + override key { symbols=[NoSymbol, NoSymbol] }; + override key { actions=[SetGroup(group=3), NoAction()] }; + override key { symbols=[Greek_alpha, NoSymbol], actions=[SetGroup(group=3), NoAction()] }; + override key { symbols=[Greek_alpha, NoSymbol] }; + override key { symbols=[NoSymbol, Greek_ALPHA] }; + override key { actions=[NoAction(), SetGroup(group=3)] }; + override key { symbols=[NoSymbol, Greek_ALPHA], actions=[NoAction(), SetGroup(group=3)] }; + override key { symbols=[Greek_alpha, Greek_ALPHA] }; + override key { actions=[SetGroup(group=3), SetGroup(group=3)] }; + override key { symbols=[Greek_alpha, Greek_ALPHA], actions=[SetGroup(group=3), SetGroup(group=3)] }; + override key { symbols=[NoSymbol, NoSymbol] }; + override key { actions=[NoAction(), NoAction()] }; + override key { symbols=[NoSymbol, NoSymbol] }; + override key { actions=[SetGroup(group=3), NoAction()] }; + override key { symbols=[Greek_alpha, NoSymbol], actions=[SetGroup(group=3), NoAction()] }; + override key { symbols=[Greek_alpha, NoSymbol] }; + override key { symbols=[NoSymbol, Greek_ALPHA] }; + override key { actions=[NoAction(), SetGroup(group=3)] }; + override key { symbols=[NoSymbol, Greek_ALPHA], actions=[NoAction(), SetGroup(group=3)] }; + override key { symbols=[Greek_alpha, Greek_ALPHA] }; + override key { actions=[SetGroup(group=3), SetGroup(group=3)] }; + override key { symbols=[Greek_alpha, Greek_ALPHA], actions=[SetGroup(group=3), SetGroup(group=3)] }; + override key { symbols=[NoSymbol, X], actions=[SetGroup(group=3), NoAction()] }; + + ////// Single keysyms -> multiple keysyms ////// + override key { symbols=[{Greek_alpha, NoSymbol}, NoSymbol] }; + override key { actions=[{SetGroup(group=3), NoAction()}, NoAction()] }; + override key { symbols=[{Greek_alpha, NoSymbol}, NoSymbol], actions=[{SetGroup(group=3), NoAction()}, NoAction()] }; + override key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, NoSymbol}] }; + override key { actions=[{SetGroup(group=3), NoAction()}, {NoAction(), NoAction()}] }; + override key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, NoSymbol}], actions=[{SetGroup(group=3), NoAction()}, {NoAction(), NoAction()}] }; + override key { symbols=[NoSymbol, {Greek_ALPHA, NoSymbol}] }; + override key { actions=[NoAction(), {SetGroup(group=3), NoAction()}] }; + override key { symbols=[NoSymbol, {Greek_ALPHA, NoSymbol}], actions=[NoAction(), {SetGroup(group=3), NoAction()}] }; + override key { symbols=[{NoSymbol, NoSymbol}, {Greek_ALPHA, NoSymbol}] }; + override key { actions=[{NoAction(), NoAction()}, {SetGroup(group=3), NoAction()}] }; + override key { symbols=[{NoSymbol, NoSymbol}, {Greek_ALPHA, NoSymbol}], actions=[{NoAction(), NoAction()}, {SetGroup(group=3), NoAction()}] }; + override key { symbols=[{Greek_alpha, NoSymbol}, {Greek_ALPHA, NoSymbol}] }; + override key { actions=[{SetGroup(group=3), NoAction()}, {SetGroup(group=3), NoAction()}] }; + override key { symbols=[{Greek_alpha, NoSymbol}, {Greek_ALPHA, NoSymbol}], actions=[{SetGroup(group=3), NoAction()}, {SetGroup(group=3), NoAction()}] }; + override key { symbols=[{Greek_alpha, Greek_upsilon}, {Greek_ALPHA, Greek_UPSILON}] }; + override key { actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + override key { symbols=[{Greek_alpha, Greek_upsilon}, {Greek_ALPHA, Greek_UPSILON}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + override key { symbols=[{Greek_alpha, NoSymbol}, NoSymbol] }; + override key { actions=[{SetGroup(group=3), NoAction()}, NoAction()] }; + override key { symbols=[{Greek_alpha, NoSymbol}, NoSymbol], actions=[{SetGroup(group=3), NoAction()}, NoAction()] }; + override key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, NoSymbol}] }; + override key { actions=[{SetGroup(group=3), NoAction()}, {NoAction(), NoAction()}] }; + override key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, NoSymbol}], actions=[{SetGroup(group=3), NoAction()}, {NoAction(), NoAction()}] }; + override key { symbols=[NoSymbol, {Greek_ALPHA, NoSymbol}] }; + override key { actions=[NoAction(), {SetGroup(group=3), NoAction()}] }; + override key { symbols=[NoSymbol, {Greek_ALPHA, NoSymbol}], actions=[NoAction(), {SetGroup(group=3), NoAction()}] }; + override key { symbols=[{NoSymbol, NoSymbol}, {Greek_ALPHA, NoSymbol}] }; + override key { actions=[{NoAction(), NoAction()}, {SetGroup(group=3), NoAction()}] }; + override key { symbols=[{NoSymbol, NoSymbol}, {Greek_ALPHA, NoSymbol}], actions=[{NoAction(), NoAction()}, {SetGroup(group=3), NoAction()}] }; + override key { symbols=[{Greek_alpha, NoSymbol}, {Greek_ALPHA, NoSymbol}] }; + override key { actions=[{SetGroup(group=3), NoAction()}, {SetGroup(group=3), NoAction()}] }; + override key { symbols=[{Greek_alpha, NoSymbol}, {Greek_ALPHA, NoSymbol}], actions=[{SetGroup(group=3), NoAction()}, {SetGroup(group=3), NoAction()}] }; + override key { symbols=[{Greek_alpha, Greek_upsilon}, {Greek_ALPHA, Greek_UPSILON}] }; + override key { actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + override key { symbols=[{Greek_alpha, Greek_upsilon}, {Greek_ALPHA, Greek_UPSILON}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + + ////// Multiple keysyms -> multiple keysyms ////// + override key { symbols=[{NoSymbol, NoSymbol}, {Greek_ALPHA, Greek_UPSILON}] }; + override key { actions=[{NoAction(), NoAction()}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + override key { symbols=[{NoSymbol, NoSymbol}, {Greek_ALPHA, Greek_UPSILON}], actions=[{NoAction(), NoAction()}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + override key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, Greek_BETA}] }; + override key { actions=[{SetGroup(group=3), NoAction()}, {NoAction(), SetGroup(group=3)}] }; + override key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, Greek_BETA}], actions=[{SetGroup(group=3), NoAction()}, {NoAction(), SetGroup(group=3)}] }; + override key { symbols=[{Greek_alpha, Greek_upsilon}, {Greek_ALPHA, Greek_UPSILON}] }; + override key { actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + override key { symbols=[{Greek_alpha, Greek_upsilon}, {Greek_ALPHA, Greek_UPSILON}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + override key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, Greek_BETA}] }; + override key { actions=[{SetGroup(group=3), NoAction()}, {NoAction(), SetGroup(group=3)}] }; + override key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, Greek_BETA}], actions=[{SetGroup(group=3), NoAction()}, {NoAction(), SetGroup(group=3)}] }; + override key { symbols=[{Greek_alpha, Greek_upsilon}, {Greek_XI, Greek_BETA}] }; + override key { actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetMods(mods=Mod5), SetGroup(group=3)}] }; + override key { symbols=[{Greek_alpha, Greek_upsilon}, {Greek_XI, Greek_BETA}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetMods(mods=Mod5), SetGroup(group=3)}] }; + override key { symbols=[{NoSymbol, NoSymbol}, {Greek_ALPHA, Greek_UPSILON}] }; + override key { actions=[{NoAction(), NoAction()}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + override key { symbols=[{NoSymbol, NoSymbol}, {Greek_ALPHA, Greek_UPSILON}], actions=[{NoAction(), NoAction()}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + override key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, Greek_BETA}] }; + override key { actions=[{SetGroup(group=3), NoAction()}, {NoAction(), SetGroup(group=3)}] }; + override key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, Greek_BETA}], actions=[{SetGroup(group=3), NoAction()}, {NoAction(), SetGroup(group=3)}] }; + override key { symbols=[{NoSymbol, NoSymbol, NoSymbol}, {NoSymbol, NoSymbol}] }; + override key { actions=[{NoAction(), NoAction(), NoAction()}, {NoAction(), NoAction()}] }; + override key { symbols=[{NoSymbol, NoSymbol, NoSymbol}, {NoSymbol, NoSymbol}] }; + override key { symbols=[{Greek_alpha, NoSymbol, Greek_xi}, {Greek_XI, Greek_BETA}] }; + override key { actions=[{SetGroup(group=3), NoAction(), SetMods(mods=Mod5)}, {SetMods(mods=Mod5), SetGroup(group=3)}] }; + override key { symbols=[{Greek_alpha, NoSymbol, Greek_xi}, {Greek_XI, Greek_BETA}], actions=[{SetGroup(group=3), NoAction(), SetMods(mods=Mod5)}, {SetMods(mods=Mod5), SetGroup(group=3)}] }; + override key { symbols=[{NoSymbol, NoSymbol, NoSymbol}, {NoSymbol, NoSymbol}] }; + override key { actions=[{NoAction(), NoAction(), NoAction()}, {NoAction(), NoAction()}] }; + override key { symbols=[{NoSymbol, NoSymbol, NoSymbol}, {NoSymbol, NoSymbol}] }; + override key { symbols=[{Greek_alpha, NoSymbol, Greek_xi}, {Greek_XI, Greek_BETA}] }; + override key { actions=[{SetGroup(group=3), NoAction(), SetMods(mods=Mod5)}, {SetMods(mods=Mod5), SetGroup(group=3)}] }; + override key { symbols=[{Greek_alpha, NoSymbol, Greek_xi}, {Greek_XI, Greek_BETA}], actions=[{SetGroup(group=3), NoAction(), SetMods(mods=Mod5)}, {SetMods(mods=Mod5), SetGroup(group=3)}] }; + + ////// Multiple keysyms -> single keysyms ////// + override key { symbols=[NoSymbol, NoSymbol] }; + override key { actions=[NoAction(), NoAction()] }; + override key { symbols=[NoSymbol, NoSymbol] }; + override key { symbols=[Greek_alpha, Greek_ALPHA] }; + override key { actions=[SetGroup(group=3), SetGroup(group=3)] }; + override key { symbols=[Greek_alpha, Greek_ALPHA], actions=[SetGroup(group=3), SetGroup(group=3)] }; + override key { symbols=[NoSymbol, NoSymbol] }; + override key { actions=[NoAction(), NoAction()] }; + override key { symbols=[NoSymbol, NoSymbol] }; + override key { symbols=[Greek_alpha, Greek_ALPHA] }; + override key { actions=[SetGroup(group=3), SetGroup(group=3)] }; + override key { symbols=[Greek_alpha, Greek_ALPHA], actions=[SetGroup(group=3), SetGroup(group=3)] }; + + ////// Mix ////// + override key { actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + override key { actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, SetGroup(group=3)] }; + override key { actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, SetGroup(group=3)] }; + + ////// Mix ////// + override key { symbols=[NoSymbol, {X, Y}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, NoAction()] }; + + ////// Multiple keysyms/actions –> single ////// + override key { symbols=[NoSymbol, X], actions=[SetGroup(group=3), NoAction()] }; + + ////// Multiple keysyms/actions –> multiple (xor) ////// + override key { symbols=[NoSymbol, {X, Y}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, NoAction()] }; + + ////// Multiple keysyms/actions –> multiple (mix) ////// + override key { symbols=[{x, y}, {X, Y}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + override key { symbols=[{x, NoSymbol}, {X, Y}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), NoAction()}] }; + + ////// Multiple (mix) –> multiple keysyms/actions ////// + override key { symbols=[{x, NoSymbol}, NoSymbol], actions=[NoAction(), {SetGroup(group=3), NoAction()}] }; + override key { symbols=[{x, y}, NoSymbol], actions=[NoAction(), {SetGroup(group=3), SetMods(mods=Mod5)}] }; + + ////// Multiple (mix) –> multiple (mix) ////// + override key { symbols=[{NoSymbol, y}, {X, Y}], actions=[{SetGroup(group=3), NoAction()}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + override key { symbols=[{NoSymbol, y}, {X, NoSymbol}], actions=[{NoAction(), SetMods(mods=Mod5)}, {SetGroup(group=3), NoAction()}] }; + + ////// Mismatch count with mix ////// + override key { actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, SetGroup(group=3)] }; + override key { symbols=[{A, B}, a] }; + override key { symbols=[{x, y}, X], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, SetGroup(group=3)] }; + + ////// Issue #564 ////// + override key { symbols=[{A, A}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}] }; +}; + +xkb_symbols "new-replace" { + include "merge_modes(base)" + + ////// Trivial cases ////// + replace key { }; + replace key { }; + replace key { }; + replace key { symbols=[Greek_alpha] }; + replace key { actions=[SetGroup(group=3)] }; + replace key { symbols=[Greek_alpha], actions=[SetGroup(group=3)] }; + replace key { }; + replace key { }; + replace key { }; + + ////// Same key ////// + replace key { symbols=[a] }; + replace key { actions=[SetGroup(group=2)] }; + replace key { symbols=[a], actions=[SetGroup(group=2)] }; + replace key { symbols=[a, {A, Y}] }; + replace key { actions=[SetGroup(group=2), {SetGroup(group=2), SetMods(mods=Control)}] }; + replace key { symbols=[a, {A, Y}], actions=[SetGroup(group=2), {SetGroup(group=2), SetMods(mods=Control)}] }; + + ////// Mismatch levels count ////// + replace key { actions=[SetGroup(group=3), NoAction(), NoAction()] }; + replace key { symbols=[Greek_alpha, NoSymbol, NoSymbol], actions=[SetGroup(group=3), NoAction(), NoAction()] }; + replace key { symbols=[Greek_alpha, NoSymbol, NoSymbol] }; + replace key { actions=[SetGroup(group=3), NoAction(), NoAction()] }; + replace key { symbols=[Greek_alpha, NoSymbol, NoSymbol], actions=[SetGroup(group=3), NoAction(), NoAction()] }; + replace key { actions=[SetGroup(group=3), NoAction()] }; + replace key { symbols=[Greek_alpha, NoSymbol], actions=[SetGroup(group=3), NoAction()] }; + replace key { symbols=[Greek_alpha, NoSymbol] }; + replace key { symbols=[Greek_alpha, Greek_ALPHA, Greek_alpha] }; + replace key { actions=[SetGroup(group=3), SetGroup(group=3), SetGroup(group=3)] }; + replace key { symbols=[Greek_alpha, Greek_ALPHA, Greek_alpha], actions=[SetGroup(group=3), SetGroup(group=3), SetGroup(group=3)] }; + replace key { symbols=[Greek_alpha, Greek_ALPHA] }; + replace key { actions=[SetGroup(group=3), SetGroup(group=3)] }; + replace key { symbols=[Greek_alpha, Greek_ALPHA], actions=[SetGroup(group=3), SetGroup(group=3)] }; + + ////// Single keysyms -> single keysyms ////// + replace key { symbols=[NoSymbol, NoSymbol] }; + replace key { actions=[NoAction(), NoAction()] }; + replace key { symbols=[NoSymbol, NoSymbol] }; + replace key { actions=[SetGroup(group=3), NoAction()] }; + replace key { symbols=[Greek_alpha, NoSymbol], actions=[SetGroup(group=3), NoAction()] }; + replace key { symbols=[Greek_alpha, NoSymbol] }; + replace key { symbols=[NoSymbol, Greek_ALPHA] }; + replace key { actions=[NoAction(), SetGroup(group=3)] }; + replace key { symbols=[NoSymbol, Greek_ALPHA], actions=[NoAction(), SetGroup(group=3)] }; + replace key { symbols=[Greek_alpha, Greek_ALPHA] }; + replace key { actions=[SetGroup(group=3), SetGroup(group=3)] }; + replace key { symbols=[Greek_alpha, Greek_ALPHA], actions=[SetGroup(group=3), SetGroup(group=3)] }; + replace key { symbols=[NoSymbol, NoSymbol] }; + replace key { actions=[NoAction(), NoAction()] }; + replace key { symbols=[NoSymbol, NoSymbol] }; + replace key { actions=[SetGroup(group=3), NoAction()] }; + replace key { symbols=[Greek_alpha, NoSymbol], actions=[SetGroup(group=3), NoAction()] }; + replace key { symbols=[Greek_alpha, NoSymbol] }; + replace key { symbols=[NoSymbol, Greek_ALPHA] }; + replace key { actions=[NoAction(), SetGroup(group=3)] }; + replace key { symbols=[NoSymbol, Greek_ALPHA], actions=[NoAction(), SetGroup(group=3)] }; + replace key { symbols=[Greek_alpha, Greek_ALPHA] }; + replace key { actions=[SetGroup(group=3), SetGroup(group=3)] }; + replace key { symbols=[Greek_alpha, Greek_ALPHA], actions=[SetGroup(group=3), SetGroup(group=3)] }; + replace key { symbols=[NoSymbol, X], actions=[SetGroup(group=3), NoAction()] }; + + ////// Single keysyms -> multiple keysyms ////// + replace key { symbols=[{Greek_alpha, NoSymbol}, NoSymbol] }; + replace key { actions=[{SetGroup(group=3), NoAction()}, NoAction()] }; + replace key { symbols=[{Greek_alpha, NoSymbol}, NoSymbol], actions=[{SetGroup(group=3), NoAction()}, NoAction()] }; + replace key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, NoSymbol}] }; + replace key { actions=[{SetGroup(group=3), NoAction()}, {NoAction(), NoAction()}] }; + replace key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, NoSymbol}], actions=[{SetGroup(group=3), NoAction()}, {NoAction(), NoAction()}] }; + replace key { symbols=[NoSymbol, {Greek_ALPHA, NoSymbol}] }; + replace key { actions=[NoAction(), {SetGroup(group=3), NoAction()}] }; + replace key { symbols=[NoSymbol, {Greek_ALPHA, NoSymbol}], actions=[NoAction(), {SetGroup(group=3), NoAction()}] }; + replace key { symbols=[{NoSymbol, NoSymbol}, {Greek_ALPHA, NoSymbol}] }; + replace key { actions=[{NoAction(), NoAction()}, {SetGroup(group=3), NoAction()}] }; + replace key { symbols=[{NoSymbol, NoSymbol}, {Greek_ALPHA, NoSymbol}], actions=[{NoAction(), NoAction()}, {SetGroup(group=3), NoAction()}] }; + replace key { symbols=[{Greek_alpha, NoSymbol}, {Greek_ALPHA, NoSymbol}] }; + replace key { actions=[{SetGroup(group=3), NoAction()}, {SetGroup(group=3), NoAction()}] }; + replace key { symbols=[{Greek_alpha, NoSymbol}, {Greek_ALPHA, NoSymbol}], actions=[{SetGroup(group=3), NoAction()}, {SetGroup(group=3), NoAction()}] }; + replace key { symbols=[{Greek_alpha, Greek_upsilon}, {Greek_ALPHA, Greek_UPSILON}] }; + replace key { actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + replace key { symbols=[{Greek_alpha, Greek_upsilon}, {Greek_ALPHA, Greek_UPSILON}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + replace key { symbols=[{Greek_alpha, NoSymbol}, NoSymbol] }; + replace key { actions=[{SetGroup(group=3), NoAction()}, NoAction()] }; + replace key { symbols=[{Greek_alpha, NoSymbol}, NoSymbol], actions=[{SetGroup(group=3), NoAction()}, NoAction()] }; + replace key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, NoSymbol}] }; + replace key { actions=[{SetGroup(group=3), NoAction()}, {NoAction(), NoAction()}] }; + replace key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, NoSymbol}], actions=[{SetGroup(group=3), NoAction()}, {NoAction(), NoAction()}] }; + replace key { symbols=[NoSymbol, {Greek_ALPHA, NoSymbol}] }; + replace key { actions=[NoAction(), {SetGroup(group=3), NoAction()}] }; + replace key { symbols=[NoSymbol, {Greek_ALPHA, NoSymbol}], actions=[NoAction(), {SetGroup(group=3), NoAction()}] }; + replace key { symbols=[{NoSymbol, NoSymbol}, {Greek_ALPHA, NoSymbol}] }; + replace key { actions=[{NoAction(), NoAction()}, {SetGroup(group=3), NoAction()}] }; + replace key { symbols=[{NoSymbol, NoSymbol}, {Greek_ALPHA, NoSymbol}], actions=[{NoAction(), NoAction()}, {SetGroup(group=3), NoAction()}] }; + replace key { symbols=[{Greek_alpha, NoSymbol}, {Greek_ALPHA, NoSymbol}] }; + replace key { actions=[{SetGroup(group=3), NoAction()}, {SetGroup(group=3), NoAction()}] }; + replace key { symbols=[{Greek_alpha, NoSymbol}, {Greek_ALPHA, NoSymbol}], actions=[{SetGroup(group=3), NoAction()}, {SetGroup(group=3), NoAction()}] }; + replace key { symbols=[{Greek_alpha, Greek_upsilon}, {Greek_ALPHA, Greek_UPSILON}] }; + replace key { actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + replace key { symbols=[{Greek_alpha, Greek_upsilon}, {Greek_ALPHA, Greek_UPSILON}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + + ////// Multiple keysyms -> multiple keysyms ////// + replace key { symbols=[{NoSymbol, NoSymbol}, {Greek_ALPHA, Greek_UPSILON}] }; + replace key { actions=[{NoAction(), NoAction()}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + replace key { symbols=[{NoSymbol, NoSymbol}, {Greek_ALPHA, Greek_UPSILON}], actions=[{NoAction(), NoAction()}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + replace key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, Greek_BETA}] }; + replace key { actions=[{SetGroup(group=3), NoAction()}, {NoAction(), SetGroup(group=3)}] }; + replace key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, Greek_BETA}], actions=[{SetGroup(group=3), NoAction()}, {NoAction(), SetGroup(group=3)}] }; + replace key { symbols=[{Greek_alpha, Greek_upsilon}, {Greek_ALPHA, Greek_UPSILON}] }; + replace key { actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + replace key { symbols=[{Greek_alpha, Greek_upsilon}, {Greek_ALPHA, Greek_UPSILON}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + replace key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, Greek_BETA}] }; + replace key { actions=[{SetGroup(group=3), NoAction()}, {NoAction(), SetGroup(group=3)}] }; + replace key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, Greek_BETA}], actions=[{SetGroup(group=3), NoAction()}, {NoAction(), SetGroup(group=3)}] }; + replace key { symbols=[{Greek_alpha, Greek_upsilon}, {Greek_XI, Greek_BETA}] }; + replace key { actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetMods(mods=Mod5), SetGroup(group=3)}] }; + replace key { symbols=[{Greek_alpha, Greek_upsilon}, {Greek_XI, Greek_BETA}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetMods(mods=Mod5), SetGroup(group=3)}] }; + replace key { symbols=[{NoSymbol, NoSymbol}, {Greek_ALPHA, Greek_UPSILON}] }; + replace key { actions=[{NoAction(), NoAction()}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + replace key { symbols=[{NoSymbol, NoSymbol}, {Greek_ALPHA, Greek_UPSILON}], actions=[{NoAction(), NoAction()}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + replace key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, Greek_BETA}] }; + replace key { actions=[{SetGroup(group=3), NoAction()}, {NoAction(), SetGroup(group=3)}] }; + replace key { symbols=[{Greek_alpha, NoSymbol}, {NoSymbol, Greek_BETA}], actions=[{SetGroup(group=3), NoAction()}, {NoAction(), SetGroup(group=3)}] }; + replace key { symbols=[{NoSymbol, NoSymbol, NoSymbol}, {NoSymbol, NoSymbol}] }; + replace key { actions=[{NoAction(), NoAction(), NoAction()}, {NoAction(), NoAction()}] }; + replace key { symbols=[{NoSymbol, NoSymbol, NoSymbol}, {NoSymbol, NoSymbol}] }; + replace key { symbols=[{Greek_alpha, NoSymbol, Greek_xi}, {Greek_XI, Greek_BETA}] }; + replace key { actions=[{SetGroup(group=3), NoAction(), SetMods(mods=Mod5)}, {SetMods(mods=Mod5), SetGroup(group=3)}] }; + replace key { symbols=[{Greek_alpha, NoSymbol, Greek_xi}, {Greek_XI, Greek_BETA}], actions=[{SetGroup(group=3), NoAction(), SetMods(mods=Mod5)}, {SetMods(mods=Mod5), SetGroup(group=3)}] }; + replace key { symbols=[{NoSymbol, NoSymbol, NoSymbol}, {NoSymbol, NoSymbol}] }; + replace key { actions=[{NoAction(), NoAction(), NoAction()}, {NoAction(), NoAction()}] }; + replace key { symbols=[{NoSymbol, NoSymbol, NoSymbol}, {NoSymbol, NoSymbol}] }; + replace key { symbols=[{Greek_alpha, NoSymbol, Greek_xi}, {Greek_XI, Greek_BETA}] }; + replace key { actions=[{SetGroup(group=3), NoAction(), SetMods(mods=Mod5)}, {SetMods(mods=Mod5), SetGroup(group=3)}] }; + replace key { symbols=[{Greek_alpha, NoSymbol, Greek_xi}, {Greek_XI, Greek_BETA}], actions=[{SetGroup(group=3), NoAction(), SetMods(mods=Mod5)}, {SetMods(mods=Mod5), SetGroup(group=3)}] }; + + ////// Multiple keysyms -> single keysyms ////// + replace key { symbols=[NoSymbol, NoSymbol] }; + replace key { actions=[NoAction(), NoAction()] }; + replace key { symbols=[NoSymbol, NoSymbol] }; + replace key { symbols=[Greek_alpha, Greek_ALPHA] }; + replace key { actions=[SetGroup(group=3), SetGroup(group=3)] }; + replace key { symbols=[Greek_alpha, Greek_ALPHA], actions=[SetGroup(group=3), SetGroup(group=3)] }; + replace key { symbols=[NoSymbol, NoSymbol] }; + replace key { actions=[NoAction(), NoAction()] }; + replace key { symbols=[NoSymbol, NoSymbol] }; + replace key { symbols=[Greek_alpha, Greek_ALPHA] }; + replace key { actions=[SetGroup(group=3), SetGroup(group=3)] }; + replace key { symbols=[Greek_alpha, Greek_ALPHA], actions=[SetGroup(group=3), SetGroup(group=3)] }; + + ////// Mix ////// + replace key { actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + replace key { actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, SetGroup(group=3)] }; + replace key { actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, SetGroup(group=3)] }; + + ////// Mix ////// + replace key { symbols=[NoSymbol, {X, Y}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, NoAction()] }; + + ////// Multiple keysyms/actions –> single ////// + replace key { symbols=[NoSymbol, X], actions=[SetGroup(group=3), NoAction()] }; + + ////// Multiple keysyms/actions –> multiple (xor) ////// + replace key { symbols=[NoSymbol, {X, Y}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, NoAction()] }; + + ////// Multiple keysyms/actions –> multiple (mix) ////// + replace key { symbols=[{x, y}, {X, Y}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + replace key { symbols=[{x, NoSymbol}, {X, Y}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, {SetGroup(group=3), NoAction()}] }; + + ////// Multiple (mix) –> multiple keysyms/actions ////// + replace key { symbols=[{x, NoSymbol}, NoSymbol], actions=[NoAction(), {SetGroup(group=3), NoAction()}] }; + replace key { symbols=[{x, y}, NoSymbol], actions=[NoAction(), {SetGroup(group=3), SetMods(mods=Mod5)}] }; + + ////// Multiple (mix) –> multiple (mix) ////// + replace key { symbols=[{NoSymbol, y}, {X, Y}], actions=[{SetGroup(group=3), NoAction()}, {SetGroup(group=3), SetMods(mods=Mod5)}] }; + replace key { symbols=[{NoSymbol, y}, {X, NoSymbol}], actions=[{NoAction(), SetMods(mods=Mod5)}, {SetGroup(group=3), NoAction()}] }; + + ////// Mismatch count with mix ////// + replace key { actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, SetGroup(group=3)] }; + replace key { symbols=[{A, B}, a] }; + replace key { symbols=[{x, y}, X], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}, SetGroup(group=3)] }; + + ////// Issue #564 ////// + replace key { symbols=[{A, A}], actions=[{SetGroup(group=3), SetMods(mods=Mod5)}] }; +}; diff --git a/test_files/compile-tests/.gitattributes b/test_files/compile-tests/.gitattributes new file mode 100644 index 00000000..fcadb2cf --- /dev/null +++ b/test_files/compile-tests/.gitattributes @@ -0,0 +1 @@ +* text eol=lf diff --git a/test_files/compile-tests/.gitignore b/test_files/compile-tests/.gitignore new file mode 100644 index 00000000..5a08f9f1 --- /dev/null +++ b/test_files/compile-tests/.gitignore @@ -0,0 +1,3 @@ +round_trip.xkb +actual.xkb +actual.toml diff --git a/test_files/compile-tests/t00/t000/t0001/expected.xkb b/test_files/compile-tests/t00/t000/t0001/expected.xkb new file mode 100644 index 00000000..961c8f2f --- /dev/null +++ b/test_files/compile-tests/t00/t000/t0001/expected.xkb @@ -0,0 +1,21 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t00/t000/t0001/input.xkb b/test_files/compile-tests/t00/t000/t0001/input.xkb new file mode 100644 index 00000000..61c33ad8 --- /dev/null +++ b/test_files/compile-tests/t00/t000/t0001/input.xkb @@ -0,0 +1,2 @@ +xkb_keymap { +}; diff --git a/test_files/compile-tests/t00/t000/t0002/expected.xkb b/test_files/compile-tests/t00/t000/t0002/expected.xkb new file mode 100644 index 00000000..a5d21ec1 --- /dev/null +++ b/test_files/compile-tests/t00/t000/t0002/expected.xkb @@ -0,0 +1,34 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "X"; + indicator 2 = "alpha"; + indicator 3 = "Z"; + virtual indicator 4 = "beta"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + indicator "X" { + modifiers = Mod1+Mod2; + whichModState = Latched+Locked; + groups = 0x00000006; + controls = StickyKeys; + }; + indicator "alpha" { + groups = 0x00000003; + }; + + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t00/t000/t0002/input.xkb b/test_files/compile-tests/t00/t000/t0002/input.xkb new file mode 100644 index 00000000..0eee91bf --- /dev/null +++ b/test_files/compile-tests/t00/t000/t0002/input.xkb @@ -0,0 +1,27 @@ +xkb_keymap { + xkb_keycodes { + indicator 1 = "X"; + indicator 2 = "Y"; + include "a.xkb" + override "b.xkb" + }; + xkb_compat { + indicator "X" { + modifiers = Mod1+Mod2; + groups = Group2+Group3; + whichGroupState = Effective; + }; + indicator "X" { + controls = StickyKeys; + whichModState = Locked+Latched; + }; + indicator "alpha" { + modifiers = Mod1; + }; + replace indicator "alpha" { + groups = 3; + }; + indicator "beta" { + }; + }; +}; diff --git a/test_files/compile-tests/t00/t000/t0002/keycodes/a.xkb b/test_files/compile-tests/t00/t000/t0002/keycodes/a.xkb new file mode 100644 index 00000000..9d90a992 --- /dev/null +++ b/test_files/compile-tests/t00/t000/t0002/keycodes/a.xkb @@ -0,0 +1,3 @@ +xkb_keycodes { + indicator 3 = "Z"; +}; diff --git a/test_files/compile-tests/t00/t000/t0002/keycodes/b.xkb b/test_files/compile-tests/t00/t000/t0002/keycodes/b.xkb new file mode 100644 index 00000000..2da573c6 --- /dev/null +++ b/test_files/compile-tests/t00/t000/t0002/keycodes/b.xkb @@ -0,0 +1,3 @@ +xkb_keycodes { + indicator 2 = "alpha"; +}; diff --git a/test_files/compile-tests/t00/t000/t0003/expected.xkb b/test_files/compile-tests/t00/t000/t0003/expected.xkb new file mode 100644 index 00000000..b64f36c4 --- /dev/null +++ b/test_files/compile-tests/t00/t000/t0003/expected.xkb @@ -0,0 +1,28 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 2; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + repeat = false + }; + }; +}; diff --git a/test_files/compile-tests/t00/t000/t0003/input.xkb b/test_files/compile-tests/t00/t000/t0003/input.xkb new file mode 100644 index 00000000..373cd3c6 --- /dev/null +++ b/test_files/compile-tests/t00/t000/t0003/input.xkb @@ -0,0 +1,12 @@ +xkb_keymap { + xkb_keycodes { + = 1; + = 2; + alias = ; + alias = ; + alias = ; + }; + xkb_symbols { + key { }; + }; +}; diff --git a/test_files/compile-tests/t00/t000/t0004/compat/a.xkb b/test_files/compile-tests/t00/t000/t0004/compat/a.xkb new file mode 100644 index 00000000..a43c8faa --- /dev/null +++ b/test_files/compile-tests/t00/t000/t0004/compat/a.xkb @@ -0,0 +1,3 @@ +default xkb_compat { + include "b.xkb" +}; diff --git a/test_files/compile-tests/t00/t000/t0004/compat/b.xkb b/test_files/compile-tests/t00/t000/t0004/compat/b.xkb new file mode 100644 index 00000000..603adee7 --- /dev/null +++ b/test_files/compile-tests/t00/t000/t0004/compat/b.xkb @@ -0,0 +1,12 @@ +default xkb_compatibility "x" { + indicator "Caps Lock" { + whichModState= Locked; + modifiers= Lock; + }; +}; + +xkb_compatibility "y" { + indicator "Caps Lock" { + groups=All-group1; + }; +}; diff --git a/test_files/compile-tests/t00/t000/t0004/expected.xkb b/test_files/compile-tests/t00/t000/t0004/expected.xkb new file mode 100644 index 00000000..84a50753 --- /dev/null +++ b/test_files/compile-tests/t00/t000/t0004/expected.xkb @@ -0,0 +1,27 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + virtual indicator 1 = "Caps Lock"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + indicator "Caps Lock" { + modifiers = Lock; + whichModState = Locked; + groups = 0xfffffffe; + }; + + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t00/t000/t0004/input.xkb b/test_files/compile-tests/t00/t000/t0004/input.xkb new file mode 100644 index 00000000..dfaa4159 --- /dev/null +++ b/test_files/compile-tests/t00/t000/t0004/input.xkb @@ -0,0 +1,5 @@ +xkb_keymap { + xkb_compat { + include "a.xkb+b.xkb(y)" + }; +}; diff --git a/test_files/compile-tests/t00/t000/t0006/expected.xkb b/test_files/compile-tests/t00/t000/t0006/expected.xkb new file mode 100644 index 00000000..200dfdcb --- /dev/null +++ b/test_files/compile-tests/t00/t000/t0006/expected.xkb @@ -0,0 +1,22 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "C"; + indicator 2 = "B"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t00/t000/t0006/input.xkb b/test_files/compile-tests/t00/t000/t0006/input.xkb new file mode 100644 index 00000000..8fe00d08 --- /dev/null +++ b/test_files/compile-tests/t00/t000/t0006/input.xkb @@ -0,0 +1,9 @@ +xkb_keymap { + xkb_keycodes { + indicator 1 = "A"; + }; + xkb_keycodes { + indicator 2 = "B"; + override indicator 1 = "C"; + }; +}; diff --git a/test_files/compile-tests/t00/t000/t0007/expected.xkb b/test_files/compile-tests/t00/t000/t0007/expected.xkb new file mode 100644 index 00000000..7046bf96 --- /dev/null +++ b/test_files/compile-tests/t00/t000/t0007/expected.xkb @@ -0,0 +1,21 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + }; + + xkb_types { + virtual_modifiers x; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t00/t000/t0007/input.xkb b/test_files/compile-tests/t00/t000/t0007/input.xkb new file mode 100644 index 00000000..bb3c3226 --- /dev/null +++ b/test_files/compile-tests/t00/t000/t0007/input.xkb @@ -0,0 +1,5 @@ +xkb_keymap { + xkb_types { + virtual_modifiers x; + }; +}; diff --git a/test_files/compile-tests/t00/t001/t0018/expected.xkb b/test_files/compile-tests/t00/t001/t0018/expected.xkb new file mode 100644 index 00000000..0fc7cb8b --- /dev/null +++ b/test_files/compile-tests/t00/t001/t0018/expected.xkb @@ -0,0 +1,35 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ A ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t001/t0018/input.xkb b/test_files/compile-tests/t00/t001/t0018/input.xkb new file mode 100644 index 00000000..c38b963a --- /dev/null +++ b/test_files/compile-tests/t00/t001/t0018/input.xkb @@ -0,0 +1,8 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_symbols { + key { [ A ] }; + }; +}; diff --git a/test_files/compile-tests/t00/t001/t0019/expected.xkb b/test_files/compile-tests/t00/t001/t0019/expected.xkb new file mode 100644 index 00000000..08856bac --- /dev/null +++ b/test_files/compile-tests/t00/t001/t0019/expected.xkb @@ -0,0 +1,37 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + modmap Mod1 { }; + + key.repeat = true; + + key { + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ A ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t001/t0019/input.xkb b/test_files/compile-tests/t00/t001/t0019/input.xkb new file mode 100644 index 00000000..729a4f6f --- /dev/null +++ b/test_files/compile-tests/t00/t001/t0019/input.xkb @@ -0,0 +1,9 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_symbols { + key { [ A ] }; + modmap Mod1 { }; + }; +}; diff --git a/test_files/compile-tests/t00/t002/t0020/expected.xkb b/test_files/compile-tests/t00/t002/t0020/expected.xkb new file mode 100644 index 00000000..f1bce103 --- /dev/null +++ b/test_files/compile-tests/t00/t002/t0020/expected.xkb @@ -0,0 +1,40 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + = 2; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ A ] + }; + key { + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ A ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t002/t0020/input.xkb b/test_files/compile-tests/t00/t002/t0020/input.xkb new file mode 100644 index 00000000..e0b95bdf --- /dev/null +++ b/test_files/compile-tests/t00/t002/t0020/input.xkb @@ -0,0 +1,10 @@ +xkb_keymap { + xkb_keycodes { + = 1; + = 2; + }; + xkb_symbols { + key { [ A ] }; + key { [ A ] }; + }; +}; diff --git a/test_files/compile-tests/t00/t002/t0021/expected.xkb b/test_files/compile-tests/t00/t002/t0021/expected.xkb new file mode 100644 index 00000000..b3f4117a --- /dev/null +++ b/test_files/compile-tests/t00/t002/t0021/expected.xkb @@ -0,0 +1,37 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ A ], + actions[Group1] = [ SetMods(modifiers = Mod1) ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t002/t0021/input.xkb b/test_files/compile-tests/t00/t002/t0021/input.xkb new file mode 100644 index 00000000..5d42d482 --- /dev/null +++ b/test_files/compile-tests/t00/t002/t0021/input.xkb @@ -0,0 +1,13 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret A { + action = SetMods(mods = Mod1); + }; + }; + xkb_symbols { + key { [ A ] }; + }; +}; diff --git a/test_files/compile-tests/t00/t002/t0022/expected.xkb b/test_files/compile-tests/t00/t002/t0022/expected.xkb new file mode 100644 index 00000000..47abe335 --- /dev/null +++ b/test_files/compile-tests/t00/t002/t0022/expected.xkb @@ -0,0 +1,37 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ A ], + actions[Group1] = [ SetMods(modifiers = Mod2) ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t002/t0022/input.xkb b/test_files/compile-tests/t00/t002/t0022/input.xkb new file mode 100644 index 00000000..c94cfe6c --- /dev/null +++ b/test_files/compile-tests/t00/t002/t0022/input.xkb @@ -0,0 +1,16 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret any { + action = SetMods(mods = Mod1); + }; + interpret A { + action = SetMods(mods = Mod2); + }; + }; + xkb_symbols { + key { [ A ] }; + }; +}; diff --git a/test_files/compile-tests/t00/t002/t0023/expected.xkb b/test_files/compile-tests/t00/t002/t0023/expected.xkb new file mode 100644 index 00000000..cded09f1 --- /dev/null +++ b/test_files/compile-tests/t00/t002/t0023/expected.xkb @@ -0,0 +1,39 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + modmap Mod1 { }; + + key.repeat = true; + + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ A ], + actions[Group1] = [ SetMods(modifiers = Mod1) ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t002/t0023/input.xkb b/test_files/compile-tests/t00/t002/t0023/input.xkb new file mode 100644 index 00000000..ce054ded --- /dev/null +++ b/test_files/compile-tests/t00/t002/t0023/input.xkb @@ -0,0 +1,17 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret A + Mod1 { + action = SetMods(mods = Mod1); + }; + interpret A + AllOf(Mod1) { + action = SetMods(mods = Mod2); + }; + }; + xkb_symbols { + key { [ A ] }; + modmap Mod1 { }; + }; +}; diff --git a/test_files/compile-tests/t00/t002/t0024/expected.xkb b/test_files/compile-tests/t00/t002/t0024/expected.xkb new file mode 100644 index 00000000..cded09f1 --- /dev/null +++ b/test_files/compile-tests/t00/t002/t0024/expected.xkb @@ -0,0 +1,39 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + modmap Mod1 { }; + + key.repeat = true; + + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ A ], + actions[Group1] = [ SetMods(modifiers = Mod1) ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t002/t0024/input.xkb b/test_files/compile-tests/t00/t002/t0024/input.xkb new file mode 100644 index 00000000..30f0991c --- /dev/null +++ b/test_files/compile-tests/t00/t002/t0024/input.xkb @@ -0,0 +1,17 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret A + AllOf(Mod1) { + action = SetMods(mods = Mod1); + }; + interpret A + NoneOf(Mod2) { + action = SetMods(mods = Mod2); + }; + }; + xkb_symbols { + key { [ A ] }; + modmap Mod1 { }; + }; +}; diff --git a/test_files/compile-tests/t00/t002/t0025/expected.xkb b/test_files/compile-tests/t00/t002/t0025/expected.xkb new file mode 100644 index 00000000..cded09f1 --- /dev/null +++ b/test_files/compile-tests/t00/t002/t0025/expected.xkb @@ -0,0 +1,39 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + modmap Mod1 { }; + + key.repeat = true; + + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ A ], + actions[Group1] = [ SetMods(modifiers = Mod1) ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t002/t0025/input.xkb b/test_files/compile-tests/t00/t002/t0025/input.xkb new file mode 100644 index 00000000..7145268d --- /dev/null +++ b/test_files/compile-tests/t00/t002/t0025/input.xkb @@ -0,0 +1,17 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret A + NoneOf(Mod2) { + action = SetMods(mods = Mod1); + }; + interpret A + AnyOf(Mod1) { + action = SetMods(mods = Mod2); + }; + }; + xkb_symbols { + key { [ A ] }; + modmap Mod1 { }; + }; +}; diff --git a/test_files/compile-tests/t00/t002/t0026/expected.xkb b/test_files/compile-tests/t00/t002/t0026/expected.xkb new file mode 100644 index 00000000..cded09f1 --- /dev/null +++ b/test_files/compile-tests/t00/t002/t0026/expected.xkb @@ -0,0 +1,39 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + modmap Mod1 { }; + + key.repeat = true; + + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ A ], + actions[Group1] = [ SetMods(modifiers = Mod1) ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t002/t0026/input.xkb b/test_files/compile-tests/t00/t002/t0026/input.xkb new file mode 100644 index 00000000..63abdfd0 --- /dev/null +++ b/test_files/compile-tests/t00/t002/t0026/input.xkb @@ -0,0 +1,17 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret A + AnyOf(Mod1) { + action = SetMods(mods = Mod1); + }; + interpret A + AnyOfOrNone(Mod1) { + action = SetMods(mods = Mod2); + }; + }; + xkb_symbols { + key { [ A ] }; + modmap Mod1 { }; + }; +}; diff --git a/test_files/compile-tests/t00/t002/t0027/expected.xkb b/test_files/compile-tests/t00/t002/t0027/expected.xkb new file mode 100644 index 00000000..4c502ed8 --- /dev/null +++ b/test_files/compile-tests/t00/t002/t0027/expected.xkb @@ -0,0 +1,39 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + modmap Mod1 { }; + + key.repeat = true; + + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ A ], + actions[Group1] = [ SetMods(modifiers = Mod2) ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t002/t0027/input.xkb b/test_files/compile-tests/t00/t002/t0027/input.xkb new file mode 100644 index 00000000..ed16188b --- /dev/null +++ b/test_files/compile-tests/t00/t002/t0027/input.xkb @@ -0,0 +1,17 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret any + AnyOf(Mod1) { + action = SetMods(mods = Mod1); + }; + interpret A + AnyOfOrNone(Mod1) { + action = SetMods(mods = Mod2); + }; + }; + xkb_symbols { + key { [ A ] }; + modmap Mod1 { }; + }; +}; diff --git a/test_files/compile-tests/t00/t002/t0028/expected.xkb b/test_files/compile-tests/t00/t002/t0028/expected.xkb new file mode 100644 index 00000000..b3f4117a --- /dev/null +++ b/test_files/compile-tests/t00/t002/t0028/expected.xkb @@ -0,0 +1,37 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ A ], + actions[Group1] = [ SetMods(modifiers = Mod1) ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t002/t0028/input.xkb b/test_files/compile-tests/t00/t002/t0028/input.xkb new file mode 100644 index 00000000..a9ce947b --- /dev/null +++ b/test_files/compile-tests/t00/t002/t0028/input.xkb @@ -0,0 +1,16 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret any + NoneOf(Mod1) { + action = SetMods(mods = Mod1); + }; + interpret any + NoneOf(Mod2) { + action = SetMods(mods = Mod2); + }; + }; + xkb_symbols { + key { [ A ] }; + }; +}; diff --git a/test_files/compile-tests/t00/t003/t0030/expected.xkb b/test_files/compile-tests/t00/t003/t0030/expected.xkb new file mode 100644 index 00000000..91fd9d0d --- /dev/null +++ b/test_files/compile-tests/t00/t003/t0030/expected.xkb @@ -0,0 +1,48 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + = 2; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ALPHABETIC" { + modifiers = Shift+Lock; + level_name[Level1] = "Base"; + level_name[Level2] = "Caps"; + map[Shift] = Level2; + map[Lock] = Level2; + }; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ a ] + }; + key { + type[Group1] = "ALPHABETIC", + symbols[Group1] = [ a, A ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t003/t0030/input.xkb b/test_files/compile-tests/t00/t003/t0030/input.xkb new file mode 100644 index 00000000..e712fcf8 --- /dev/null +++ b/test_files/compile-tests/t00/t003/t0030/input.xkb @@ -0,0 +1,16 @@ +xkb_keymap { + xkb_keycodes { + = 1; + = 2; + }; + xkb_symbols { + key { + type = "ONE_LEVEL", + [ a ] + }; + key { + type = "one_level", + [ a, A ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t003/t0031/expected.xkb b/test_files/compile-tests/t00/t003/t0031/expected.xkb new file mode 100644 index 00000000..e046ed1b --- /dev/null +++ b/test_files/compile-tests/t00/t003/t0031/expected.xkb @@ -0,0 +1,33 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 2; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "X" { + modifiers = None; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + type[Group1] = "X", + symbols[Group1] = [ a, A ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t003/t0031/input.xkb b/test_files/compile-tests/t00/t003/t0031/input.xkb new file mode 100644 index 00000000..ef6b3d65 --- /dev/null +++ b/test_files/compile-tests/t00/t003/t0031/input.xkb @@ -0,0 +1,16 @@ +xkb_keymap { + xkb_keycodes { + = 1; + = 2; + }; + xkb_types { + type "X" { + }; + }; + xkb_symbols { + key { + type = "X", + [ a, A ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t005/t0051/expected.xkb b/test_files/compile-tests/t00/t005/t0051/expected.xkb new file mode 100644 index 00000000..cb91dfc4 --- /dev/null +++ b/test_files/compile-tests/t00/t005/t0051/expected.xkb @@ -0,0 +1,35 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers X = Mod1; + + type "A" { + modifiers = Mod1; + map[Mod1] = Level1; + preserve[Mod1] = Mod1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + type[Group1] = "A", + symbols[Group1] = [ A ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t005/t0051/input.xkb b/test_files/compile-tests/t00/t005/t0051/input.xkb new file mode 100644 index 00000000..3ba5a4fe --- /dev/null +++ b/test_files/compile-tests/t00/t005/t0051/input.xkb @@ -0,0 +1,20 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_types { + virtual_modifiers X = Mod1; + + type "A" { + modifiers = X; + map[X] = Level1; + preserve[X] = X; + }; + }; + xkb_symbols { + key { + type = "A", + [ A ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t005/t0052/expected.xkb b/test_files/compile-tests/t00/t005/t0052/expected.xkb new file mode 100644 index 00000000..82a31b84 --- /dev/null +++ b/test_files/compile-tests/t00/t005/t0052/expected.xkb @@ -0,0 +1,35 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers X = Mod1; + + type "A" { + modifiers = Mod1; + map[Mod1] = Level2; + preserve[Mod1] = Mod3; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + type[Group1] = "A", + symbols[Group1] = [ A ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t005/t0052/input.xkb b/test_files/compile-tests/t00/t005/t0052/input.xkb new file mode 100644 index 00000000..b5084a83 --- /dev/null +++ b/test_files/compile-tests/t00/t005/t0052/input.xkb @@ -0,0 +1,22 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_types { + virtual_modifiers X = Mod1; + + type "A" { + modifiers = Mod1+X; + map[X] = Level1; + preserve[Mod1] = Mod2; + map[Mod1] = Level2; + preserve[X] = Mod3; + }; + }; + xkb_symbols { + key { + type = "A", + [ A ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t005/t0055/expected.xkb b/test_files/compile-tests/t00/t005/t0055/expected.xkb new file mode 100644 index 00000000..18a580e3 --- /dev/null +++ b/test_files/compile-tests/t00/t005/t0055/expected.xkb @@ -0,0 +1,25 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + virtual indicator 1 = "X"; + }; + + xkb_types { + virtual_modifiers A = Mod1; + }; + + xkb_compat { + indicator "X" { + modifiers = Mod1; + }; + + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t00/t005/t0055/input.xkb b/test_files/compile-tests/t00/t005/t0055/input.xkb new file mode 100644 index 00000000..fe02c741 --- /dev/null +++ b/test_files/compile-tests/t00/t005/t0055/input.xkb @@ -0,0 +1,9 @@ +xkb_keymap { + xkb_compat { + virtual_modifiers A = Mod1; + + indicator "X" { + modifiers = A; + }; + }; +}; diff --git a/test_files/compile-tests/t00/t006/t0061/expected.xkb b/test_files/compile-tests/t00/t006/t0061/expected.xkb new file mode 100644 index 00000000..961c8f2f --- /dev/null +++ b/test_files/compile-tests/t00/t006/t0061/expected.xkb @@ -0,0 +1,21 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t00/t006/t0061/input.xkb b/test_files/compile-tests/t00/t006/t0061/input.xkb new file mode 100644 index 00000000..ee624307 --- /dev/null +++ b/test_files/compile-tests/t00/t006/t0061/input.xkb @@ -0,0 +1,10 @@ +xkb_keymap { + xkb_keycodes { + = 1; + = 1; + }; + xkb_symbols { + key { + }; + }; +}; diff --git a/test_files/compile-tests/t00/t006/t0062/expected.xkb b/test_files/compile-tests/t00/t006/t0062/expected.xkb new file mode 100644 index 00000000..ba0de3be --- /dev/null +++ b/test_files/compile-tests/t00/t006/t0062/expected.xkb @@ -0,0 +1,28 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + repeat = false + }; + }; +}; diff --git a/test_files/compile-tests/t00/t006/t0062/input.xkb b/test_files/compile-tests/t00/t006/t0062/input.xkb new file mode 100644 index 00000000..fcd09714 --- /dev/null +++ b/test_files/compile-tests/t00/t006/t0062/input.xkb @@ -0,0 +1,10 @@ +xkb_keymap { + xkb_keycodes { + = 1; + augment = 2; + }; + xkb_symbols { + key { + }; + }; +}; diff --git a/test_files/compile-tests/t00/t006/t0063/expected.xkb b/test_files/compile-tests/t00/t006/t0063/expected.xkb new file mode 100644 index 00000000..962c256a --- /dev/null +++ b/test_files/compile-tests/t00/t006/t0063/expected.xkb @@ -0,0 +1,32 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 2; + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + repeat = false + }; + key { + repeat = false + }; + }; +}; diff --git a/test_files/compile-tests/t00/t006/t0063/input.xkb b/test_files/compile-tests/t00/t006/t0063/input.xkb new file mode 100644 index 00000000..98360384 --- /dev/null +++ b/test_files/compile-tests/t00/t006/t0063/input.xkb @@ -0,0 +1,13 @@ +xkb_keymap { + xkb_keycodes { + = 1; + = 2; + augment = 1; + }; + xkb_symbols { + key { + }; + key { + }; + }; +}; diff --git a/test_files/compile-tests/t00/t006/t0064/expected.xkb b/test_files/compile-tests/t00/t006/t0064/expected.xkb new file mode 100644 index 00000000..69001b00 --- /dev/null +++ b/test_files/compile-tests/t00/t006/t0064/expected.xkb @@ -0,0 +1,21 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 2 = "X"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t00/t006/t0064/input.xkb b/test_files/compile-tests/t00/t006/t0064/input.xkb new file mode 100644 index 00000000..05b3b7a6 --- /dev/null +++ b/test_files/compile-tests/t00/t006/t0064/input.xkb @@ -0,0 +1,6 @@ +xkb_keymap { + xkb_keycodes { + indicator 1 = "X"; + indicator 2 = "X"; + }; +}; diff --git a/test_files/compile-tests/t00/t006/t0065/expected.xkb b/test_files/compile-tests/t00/t006/t0065/expected.xkb new file mode 100644 index 00000000..c58f8e6e --- /dev/null +++ b/test_files/compile-tests/t00/t006/t0065/expected.xkb @@ -0,0 +1,22 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "X"; + indicator 2 = "Y"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t00/t006/t0065/input.xkb b/test_files/compile-tests/t00/t006/t0065/input.xkb new file mode 100644 index 00000000..989d2a69 --- /dev/null +++ b/test_files/compile-tests/t00/t006/t0065/input.xkb @@ -0,0 +1,5 @@ +xkb_keymap { + xkb_keycodes { + include "x.xkb" + }; +}; diff --git a/test_files/compile-tests/t00/t006/t0065/keycodes/x.xkb b/test_files/compile-tests/t00/t006/t0065/keycodes/x.xkb new file mode 100644 index 00000000..6436fe16 --- /dev/null +++ b/test_files/compile-tests/t00/t006/t0065/keycodes/x.xkb @@ -0,0 +1,4 @@ +xkb_keycodes { + indicator 1 = "X"; + indicator 2 = "Y"; +}; diff --git a/test_files/compile-tests/t00/t006/t0066/expected.xkb b/test_files/compile-tests/t00/t006/t0066/expected.xkb new file mode 100644 index 00000000..15cb3ea1 --- /dev/null +++ b/test_files/compile-tests/t00/t006/t0066/expected.xkb @@ -0,0 +1,32 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + = 2; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + repeat = false + }; + key { + repeat = false + }; + }; +}; diff --git a/test_files/compile-tests/t00/t006/t0066/input.xkb b/test_files/compile-tests/t00/t006/t0066/input.xkb new file mode 100644 index 00000000..a0a9bec2 --- /dev/null +++ b/test_files/compile-tests/t00/t006/t0066/input.xkb @@ -0,0 +1,9 @@ +xkb_keymap { + xkb_keycodes { + include "x.xkb" + }; + xkb_symbols { + key { }; + key { }; + }; +}; diff --git a/test_files/compile-tests/t00/t006/t0066/keycodes/x.xkb b/test_files/compile-tests/t00/t006/t0066/keycodes/x.xkb new file mode 100644 index 00000000..6d77988e --- /dev/null +++ b/test_files/compile-tests/t00/t006/t0066/keycodes/x.xkb @@ -0,0 +1,4 @@ +xkb_keycodes { + = 1; + = 2; +}; diff --git a/test_files/compile-tests/t00/t007/t0074/expected.xkb b/test_files/compile-tests/t00/t007/t0074/expected.xkb new file mode 100644 index 00000000..0fc7cb8b --- /dev/null +++ b/test_files/compile-tests/t00/t007/t0074/expected.xkb @@ -0,0 +1,35 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ A ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t007/t0074/input.xkb b/test_files/compile-tests/t00/t007/t0074/input.xkb new file mode 100644 index 00000000..cf52bd4f --- /dev/null +++ b/test_files/compile-tests/t00/t007/t0074/input.xkb @@ -0,0 +1,12 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + }; + xkb_symbols { + key { + [ A ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t007/t0075/expected.xkb b/test_files/compile-tests/t00/t007/t0075/expected.xkb new file mode 100644 index 00000000..d3e9bb27 --- /dev/null +++ b/test_files/compile-tests/t00/t007/t0075/expected.xkb @@ -0,0 +1,36 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ A ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t007/t0075/input.xkb b/test_files/compile-tests/t00/t007/t0075/input.xkb new file mode 100644 index 00000000..dac7d529 --- /dev/null +++ b/test_files/compile-tests/t00/t007/t0075/input.xkb @@ -0,0 +1,14 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret A { + }; + }; + xkb_symbols { + key { + [ A ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t007/t0076/expected.xkb b/test_files/compile-tests/t00/t007/t0076/expected.xkb new file mode 100644 index 00000000..0fc7cb8b --- /dev/null +++ b/test_files/compile-tests/t00/t007/t0076/expected.xkb @@ -0,0 +1,35 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ A ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t007/t0076/input.xkb b/test_files/compile-tests/t00/t007/t0076/input.xkb new file mode 100644 index 00000000..bc426ccc --- /dev/null +++ b/test_files/compile-tests/t00/t007/t0076/input.xkb @@ -0,0 +1,15 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret A { + repeat = true; + }; + }; + xkb_symbols { + key { + [ A ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t007/t0077/expected.xkb b/test_files/compile-tests/t00/t007/t0077/expected.xkb new file mode 100644 index 00000000..9efb9367 --- /dev/null +++ b/test_files/compile-tests/t00/t007/t0077/expected.xkb @@ -0,0 +1,39 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ALPHABETIC" { + modifiers = Shift+Lock; + level_name[Level1] = "Base"; + level_name[Level2] = "Caps"; + map[Shift] = Level2; + map[Lock] = Level2; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + modmap Mod1 { }; + + key.repeat = true; + + key { + type[Group1] = "ALPHABETIC", + symbols[Group1] = [ a, A ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t007/t0077/input.xkb b/test_files/compile-tests/t00/t007/t0077/input.xkb new file mode 100644 index 00000000..8be7309e --- /dev/null +++ b/test_files/compile-tests/t00/t007/t0077/input.xkb @@ -0,0 +1,17 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret A + Mod1 { + usemodmapmods = level1; + action = SetMods(mods = Mod2); + }; + }; + xkb_symbols { + key { + [ a, A ] + }; + modmap Mod1 { }; + }; +}; diff --git a/test_files/compile-tests/t00/t007/t0078/expected.xkb b/test_files/compile-tests/t00/t007/t0078/expected.xkb new file mode 100644 index 00000000..ad0e26c1 --- /dev/null +++ b/test_files/compile-tests/t00/t007/t0078/expected.xkb @@ -0,0 +1,26 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + virtual indicator 1 = "A"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + indicator "A" { + groups = 0x00000001; + whichGroupState = Locked; + }; + + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t00/t007/t0078/input.xkb b/test_files/compile-tests/t00/t007/t0078/input.xkb new file mode 100644 index 00000000..b431dda7 --- /dev/null +++ b/test_files/compile-tests/t00/t007/t0078/input.xkb @@ -0,0 +1,8 @@ +xkb_keymap { + xkb_compat { + indicator "A" { + groups = Group1; + whichgroupstate = Locked; + }; + }; +}; diff --git a/test_files/compile-tests/t00/t007/t0079/expected.xkb b/test_files/compile-tests/t00/t007/t0079/expected.xkb new file mode 100644 index 00000000..9efb9367 --- /dev/null +++ b/test_files/compile-tests/t00/t007/t0079/expected.xkb @@ -0,0 +1,39 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ALPHABETIC" { + modifiers = Shift+Lock; + level_name[Level1] = "Base"; + level_name[Level2] = "Caps"; + map[Shift] = Level2; + map[Lock] = Level2; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + modmap Mod1 { }; + + key.repeat = true; + + key { + type[Group1] = "ALPHABETIC", + symbols[Group1] = [ a, A ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t007/t0079/input.xkb b/test_files/compile-tests/t00/t007/t0079/input.xkb new file mode 100644 index 00000000..f839b87d --- /dev/null +++ b/test_files/compile-tests/t00/t007/t0079/input.xkb @@ -0,0 +1,17 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret.usemodmapmods = level1; + interpret A + Mod1 { + action = SetMods(mods = Mod2); + }; + }; + xkb_symbols { + key { + [ a, A ] + }; + modmap Mod1 { }; + }; +}; diff --git a/test_files/compile-tests/t00/t008/t0080/expected.xkb b/test_files/compile-tests/t00/t008/t0080/expected.xkb new file mode 100644 index 00000000..a0a76349 --- /dev/null +++ b/test_files/compile-tests/t00/t008/t0080/expected.xkb @@ -0,0 +1,25 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + virtual indicator 1 = "A"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + indicator "A" { + modifiers = Mod1; + }; + + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t00/t008/t0080/input.xkb b/test_files/compile-tests/t00/t008/t0080/input.xkb new file mode 100644 index 00000000..0ee9209d --- /dev/null +++ b/test_files/compile-tests/t00/t008/t0080/input.xkb @@ -0,0 +1,6 @@ +xkb_keymap { + xkb_compat { + indicator.modifiers = Mod1; + indicator "A" { }; + }; +}; diff --git a/test_files/compile-tests/t00/t008/t0081/expected.xkb b/test_files/compile-tests/t00/t008/t0081/expected.xkb new file mode 100644 index 00000000..b3f4117a --- /dev/null +++ b/test_files/compile-tests/t00/t008/t0081/expected.xkb @@ -0,0 +1,37 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ A ], + actions[Group1] = [ SetMods(modifiers = Mod1) ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t008/t0081/input.xkb b/test_files/compile-tests/t00/t008/t0081/input.xkb new file mode 100644 index 00000000..7c489c32 --- /dev/null +++ b/test_files/compile-tests/t00/t008/t0081/input.xkb @@ -0,0 +1,18 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret A { + action = SetMods(mods = Mod1); + }; + augment interpret A { + action = SetMods(mods = Mod2); + }; + }; + xkb_symbols { + key { + [ A ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t008/t0082/expected.xkb b/test_files/compile-tests/t00/t008/t0082/expected.xkb new file mode 100644 index 00000000..47abe335 --- /dev/null +++ b/test_files/compile-tests/t00/t008/t0082/expected.xkb @@ -0,0 +1,37 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ A ], + actions[Group1] = [ SetMods(modifiers = Mod2) ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t008/t0082/input.xkb b/test_files/compile-tests/t00/t008/t0082/input.xkb new file mode 100644 index 00000000..d8615d30 --- /dev/null +++ b/test_files/compile-tests/t00/t008/t0082/input.xkb @@ -0,0 +1,18 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret A { + action = SetMods(mods = Mod1); + }; + interpret A { + action = SetMods(mods = Mod2); + }; + }; + xkb_symbols { + key { + [ A ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t008/t0083/expected.xkb b/test_files/compile-tests/t00/t008/t0083/expected.xkb new file mode 100644 index 00000000..76910328 --- /dev/null +++ b/test_files/compile-tests/t00/t008/t0083/expected.xkb @@ -0,0 +1,40 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ALPHABETIC" { + modifiers = Shift+Lock; + level_name[Level1] = "Base"; + level_name[Level2] = "Caps"; + map[Shift] = Level2; + map[Lock] = Level2; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + modmap Mod1 { }; + + key.repeat = true; + + key { + type[Group1] = "ALPHABETIC", + symbols[Group1] = [ a, A ], + actions[Group1] = [ NoAction(), SetMods(modifiers = Mod2) ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t008/t0083/input.xkb b/test_files/compile-tests/t00/t008/t0083/input.xkb new file mode 100644 index 00000000..d5dfabd7 --- /dev/null +++ b/test_files/compile-tests/t00/t008/t0083/input.xkb @@ -0,0 +1,20 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret A + Mod1 { + usemodmapmods = level1; + action = SetMods(mods = Mod1); + }; + replace interpret A + Mod1 { + action = SetMods(mods = Mod2); + }; + }; + xkb_symbols { + key { + [ a, A ] + }; + modmap Mod1 { }; + }; +}; diff --git a/test_files/compile-tests/t00/t008/t0084/expected.xkb b/test_files/compile-tests/t00/t008/t0084/expected.xkb new file mode 100644 index 00000000..47abe335 --- /dev/null +++ b/test_files/compile-tests/t00/t008/t0084/expected.xkb @@ -0,0 +1,37 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ A ], + actions[Group1] = [ SetMods(modifiers = Mod2) ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t008/t0084/input.xkb b/test_files/compile-tests/t00/t008/t0084/input.xkb new file mode 100644 index 00000000..980ad897 --- /dev/null +++ b/test_files/compile-tests/t00/t008/t0084/input.xkb @@ -0,0 +1,17 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret A { + }; + augment interpret A { + action = SetMods(mods = Mod2); + }; + }; + xkb_symbols { + key { + [ A ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t008/t0085/expected.xkb b/test_files/compile-tests/t00/t008/t0085/expected.xkb new file mode 100644 index 00000000..881a84c8 --- /dev/null +++ b/test_files/compile-tests/t00/t008/t0085/expected.xkb @@ -0,0 +1,38 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers X = Mod1; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + modmap Mod1 { }; + + key.repeat = true; + + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ A ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t008/t0085/input.xkb b/test_files/compile-tests/t00/t008/t0085/input.xkb new file mode 100644 index 00000000..5445ea84 --- /dev/null +++ b/test_files/compile-tests/t00/t008/t0085/input.xkb @@ -0,0 +1,20 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + virtual_modifiers X; + + interpret A { + }; + augment interpret A { + virtualmodifier = X; + }; + }; + xkb_symbols { + key { + [ A ] + }; + modmap Mod1 { }; + }; +}; diff --git a/test_files/compile-tests/t00/t008/t0086/expected.xkb b/test_files/compile-tests/t00/t008/t0086/expected.xkb new file mode 100644 index 00000000..0fc7cb8b --- /dev/null +++ b/test_files/compile-tests/t00/t008/t0086/expected.xkb @@ -0,0 +1,35 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ A ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t008/t0086/input.xkb b/test_files/compile-tests/t00/t008/t0086/input.xkb new file mode 100644 index 00000000..96397269 --- /dev/null +++ b/test_files/compile-tests/t00/t008/t0086/input.xkb @@ -0,0 +1,17 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret A { + }; + augment interpret A { + repeat = true; + }; + }; + xkb_symbols { + key { + [ A ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t008/t0087/expected.xkb b/test_files/compile-tests/t00/t008/t0087/expected.xkb new file mode 100644 index 00000000..6f1336e5 --- /dev/null +++ b/test_files/compile-tests/t00/t008/t0087/expected.xkb @@ -0,0 +1,39 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ALPHABETIC" { + modifiers = Shift+Lock; + level_name[Level1] = "Base"; + level_name[Level2] = "Caps"; + map[Shift] = Level2; + map[Lock] = Level2; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + modmap Mod2 { }; + + key.repeat = true; + + key { + type[Group1] = "ALPHABETIC", + symbols[Group1] = [ a, A ] + }; + }; +}; diff --git a/test_files/compile-tests/t00/t008/t0087/input.xkb b/test_files/compile-tests/t00/t008/t0087/input.xkb new file mode 100644 index 00000000..4b2e00e6 --- /dev/null +++ b/test_files/compile-tests/t00/t008/t0087/input.xkb @@ -0,0 +1,19 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret A + Mod2 { + action = SetMods(mods = Mod1); + }; + augment interpret A + Mod2 { + usemodmapmods = level1; + }; + }; + xkb_symbols { + key { + [ a, A ] + }; + modmap Mod2 { }; + }; +}; diff --git a/test_files/compile-tests/t00/t008/t0088/expected.xkb b/test_files/compile-tests/t00/t008/t0088/expected.xkb new file mode 100644 index 00000000..a0a76349 --- /dev/null +++ b/test_files/compile-tests/t00/t008/t0088/expected.xkb @@ -0,0 +1,25 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + virtual indicator 1 = "A"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + indicator "A" { + modifiers = Mod1; + }; + + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t00/t008/t0088/input.xkb b/test_files/compile-tests/t00/t008/t0088/input.xkb new file mode 100644 index 00000000..5b93779a --- /dev/null +++ b/test_files/compile-tests/t00/t008/t0088/input.xkb @@ -0,0 +1,10 @@ +xkb_keymap { + xkb_compat { + indicator "A" { + modifiers = Mod1; + }; + augment indicator "A" { + modifiers = Mod2; + }; + }; +}; diff --git a/test_files/compile-tests/t00/t008/t0089/expected.xkb b/test_files/compile-tests/t00/t008/t0089/expected.xkb new file mode 100644 index 00000000..01ab2feb --- /dev/null +++ b/test_files/compile-tests/t00/t008/t0089/expected.xkb @@ -0,0 +1,26 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + virtual indicator 1 = "A"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + indicator "A" { + modifiers = Mod1; + groups = 0x00000001; + }; + + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t00/t008/t0089/input.xkb b/test_files/compile-tests/t00/t008/t0089/input.xkb new file mode 100644 index 00000000..55177e21 --- /dev/null +++ b/test_files/compile-tests/t00/t008/t0089/input.xkb @@ -0,0 +1,10 @@ +xkb_keymap { + xkb_compat { + indicator "A" { + modifiers = Mod1; + }; + augment indicator "A" { + groups = Group1; + }; + }; +}; diff --git a/test_files/compile-tests/t00/t009/t0090/expected.xkb b/test_files/compile-tests/t00/t009/t0090/expected.xkb new file mode 100644 index 00000000..01ab2feb --- /dev/null +++ b/test_files/compile-tests/t00/t009/t0090/expected.xkb @@ -0,0 +1,26 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + virtual indicator 1 = "A"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + indicator "A" { + modifiers = Mod1; + groups = 0x00000001; + }; + + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t00/t009/t0090/input.xkb b/test_files/compile-tests/t00/t009/t0090/input.xkb new file mode 100644 index 00000000..83d49b8d --- /dev/null +++ b/test_files/compile-tests/t00/t009/t0090/input.xkb @@ -0,0 +1,10 @@ +xkb_keymap { + xkb_compat { + indicator "A" { + groups = Group1; + }; + augment indicator "A" { + modifiers = Mod1; + }; + }; +}; diff --git a/test_files/compile-tests/t00/t009/t0091/expected.xkb b/test_files/compile-tests/t00/t009/t0091/expected.xkb new file mode 100644 index 00000000..c17b9f62 --- /dev/null +++ b/test_files/compile-tests/t00/t009/t0091/expected.xkb @@ -0,0 +1,27 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + virtual indicator 1 = "A"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + indicator "A" { + modifiers = Mod1; + groups = 0x00000001; + whichGroupState = Locked; + }; + + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t00/t009/t0091/input.xkb b/test_files/compile-tests/t00/t009/t0091/input.xkb new file mode 100644 index 00000000..aa83abcb --- /dev/null +++ b/test_files/compile-tests/t00/t009/t0091/input.xkb @@ -0,0 +1,11 @@ +xkb_keymap { + xkb_compat { + indicator "A" { + modifiers = Mod1; + }; + augment indicator "A" { + groups = Group1; + whichgroupstate = Locked; + }; + }; +}; diff --git a/test_files/compile-tests/t00/t009/t0093/compat/x.xkb b/test_files/compile-tests/t00/t009/t0093/compat/x.xkb new file mode 100644 index 00000000..54ca09ba --- /dev/null +++ b/test_files/compile-tests/t00/t009/t0093/compat/x.xkb @@ -0,0 +1,6 @@ +xkb_compat { + indicator "B" { + }; + indicator "A" { + }; +}; diff --git a/test_files/compile-tests/t00/t009/t0093/expected.xkb b/test_files/compile-tests/t00/t009/t0093/expected.xkb new file mode 100644 index 00000000..d4c80a47 --- /dev/null +++ b/test_files/compile-tests/t00/t009/t0093/expected.xkb @@ -0,0 +1,22 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + virtual indicator 1 = "B"; + virtual indicator 2 = "A"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t00/t009/t0093/input.xkb b/test_files/compile-tests/t00/t009/t0093/input.xkb new file mode 100644 index 00000000..599e76bb --- /dev/null +++ b/test_files/compile-tests/t00/t009/t0093/input.xkb @@ -0,0 +1,5 @@ +xkb_keymap { + xkb_compat { + include "x.xkb" + }; +}; diff --git a/test_files/compile-tests/t00/t009/t0094/expected.xkb b/test_files/compile-tests/t00/t009/t0094/expected.xkb new file mode 100644 index 00000000..067ef97c --- /dev/null +++ b/test_files/compile-tests/t00/t009/t0094/expected.xkb @@ -0,0 +1,21 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + virtual indicator 1 = "A"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t00/t009/t0094/input.xkb b/test_files/compile-tests/t00/t009/t0094/input.xkb new file mode 100644 index 00000000..1b3ab05c --- /dev/null +++ b/test_files/compile-tests/t00/t009/t0094/input.xkb @@ -0,0 +1,6 @@ +xkb_keymap { + xkb_compat { + indicator "\101" { + }; + }; +}; diff --git a/test_files/compile-tests/t00/t009/t0095/expected.xkb b/test_files/compile-tests/t00/t009/t0095/expected.xkb new file mode 100644 index 00000000..ee3647d5 --- /dev/null +++ b/test_files/compile-tests/t00/t009/t0095/expected.xkb @@ -0,0 +1,21 @@ +xkb_keymap "A" { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t00/t009/t0095/input.xkb b/test_files/compile-tests/t00/t009/t0095/input.xkb new file mode 100644 index 00000000..1c80ff3f --- /dev/null +++ b/test_files/compile-tests/t00/t009/t0095/input.xkb @@ -0,0 +1,2 @@ +xkb_keymap "\101" { +}; diff --git a/test_files/compile-tests/t00/t009/t0096/expected.xkb b/test_files/compile-tests/t00/t009/t0096/expected.xkb new file mode 100644 index 00000000..c2e43653 --- /dev/null +++ b/test_files/compile-tests/t00/t009/t0096/expected.xkb @@ -0,0 +1,21 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "A"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t00/t009/t0096/input.xkb b/test_files/compile-tests/t00/t009/t0096/input.xkb new file mode 100644 index 00000000..d571c527 --- /dev/null +++ b/test_files/compile-tests/t00/t009/t0096/input.xkb @@ -0,0 +1,5 @@ +xkb_keymap { + xkb_keycodes { + indicator 1 = "\101"; + }; +}; diff --git a/test_files/compile-tests/t00/t009/t0099/expected.xkb b/test_files/compile-tests/t00/t009/t0099/expected.xkb new file mode 100644 index 00000000..e6098c43 --- /dev/null +++ b/test_files/compile-tests/t00/t009/t0099/expected.xkb @@ -0,0 +1,22 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + name[Group1] = "A"; + }; +}; diff --git a/test_files/compile-tests/t00/t009/t0099/input.xkb b/test_files/compile-tests/t00/t009/t0099/input.xkb new file mode 100644 index 00000000..ba9e8ea5 --- /dev/null +++ b/test_files/compile-tests/t00/t009/t0099/input.xkb @@ -0,0 +1,5 @@ +xkb_keymap { + xkb_symbols { + name[Group1] = "\101"; + }; +}; diff --git a/test_files/compile-tests/t01/t010/t0102/expected.xkb b/test_files/compile-tests/t01/t010/t0102/expected.xkb new file mode 100644 index 00000000..ba0de3be --- /dev/null +++ b/test_files/compile-tests/t01/t010/t0102/expected.xkb @@ -0,0 +1,28 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + repeat = false + }; + }; +}; diff --git a/test_files/compile-tests/t01/t010/t0102/input.xkb b/test_files/compile-tests/t01/t010/t0102/input.xkb new file mode 100644 index 00000000..c6961650 --- /dev/null +++ b/test_files/compile-tests/t01/t010/t0102/input.xkb @@ -0,0 +1,8 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_symbols { + include "x.xkb:2" + }; +}; diff --git a/test_files/compile-tests/t01/t010/t0102/symbols/x.xkb b/test_files/compile-tests/t01/t010/t0102/symbols/x.xkb new file mode 100644 index 00000000..fe75332e --- /dev/null +++ b/test_files/compile-tests/t01/t010/t0102/symbols/x.xkb @@ -0,0 +1,3 @@ +xkb_symbols { + key { }; +}; diff --git a/test_files/compile-tests/t01/t010/t0105/expected.xkb b/test_files/compile-tests/t01/t010/t0105/expected.xkb new file mode 100644 index 00000000..91275174 --- /dev/null +++ b/test_files/compile-tests/t01/t010/t0105/expected.xkb @@ -0,0 +1,30 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers A = Mod1; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + modmap Mod1 { }; + + key.repeat = true; + + key { + repeat = false + }; + }; +}; diff --git a/test_files/compile-tests/t01/t010/t0105/input.xkb b/test_files/compile-tests/t01/t010/t0105/input.xkb new file mode 100644 index 00000000..fa06f0af --- /dev/null +++ b/test_files/compile-tests/t01/t010/t0105/input.xkb @@ -0,0 +1,12 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_symbols { + virtual_modifiers A; + key { + vmods = A + }; + modmap Mod1 { }; + }; +}; diff --git a/test_files/compile-tests/t01/t011/t0110/expected.xkb b/test_files/compile-tests/t01/t011/t0110/expected.xkb new file mode 100644 index 00000000..39cd6592 --- /dev/null +++ b/test_files/compile-tests/t01/t011/t0110/expected.xkb @@ -0,0 +1,30 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + modmap Mod2 { }; + + key.repeat = true; + + key { + repeat = false + }; + }; +}; diff --git a/test_files/compile-tests/t01/t011/t0110/input.xkb b/test_files/compile-tests/t01/t011/t0110/input.xkb new file mode 100644 index 00000000..63e481d8 --- /dev/null +++ b/test_files/compile-tests/t01/t011/t0110/input.xkb @@ -0,0 +1,10 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_symbols { + key { }; + modmap Mod1 { }; + modmap Mod2 { }; + }; +}; diff --git a/test_files/compile-tests/t01/t011/t0111/expected.xkb b/test_files/compile-tests/t01/t011/t0111/expected.xkb new file mode 100644 index 00000000..4153d24f --- /dev/null +++ b/test_files/compile-tests/t01/t011/t0111/expected.xkb @@ -0,0 +1,30 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + modmap Mod1 { }; + + key.repeat = true; + + key { + repeat = false + }; + }; +}; diff --git a/test_files/compile-tests/t01/t011/t0111/input.xkb b/test_files/compile-tests/t01/t011/t0111/input.xkb new file mode 100644 index 00000000..c685cae0 --- /dev/null +++ b/test_files/compile-tests/t01/t011/t0111/input.xkb @@ -0,0 +1,10 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_symbols { + key { }; + modmap Mod1 { }; + augment modmap Mod2 { }; + }; +}; diff --git a/test_files/compile-tests/t01/t011/t0112/expected.xkb b/test_files/compile-tests/t01/t011/t0112/expected.xkb new file mode 100644 index 00000000..4153d24f --- /dev/null +++ b/test_files/compile-tests/t01/t011/t0112/expected.xkb @@ -0,0 +1,30 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + modmap Mod1 { }; + + key.repeat = true; + + key { + repeat = false + }; + }; +}; diff --git a/test_files/compile-tests/t01/t011/t0112/input.xkb b/test_files/compile-tests/t01/t011/t0112/input.xkb new file mode 100644 index 00000000..bfbacdbd --- /dev/null +++ b/test_files/compile-tests/t01/t011/t0112/input.xkb @@ -0,0 +1,9 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_symbols { + key { }; + augment modmap Mod1 { }; + }; +}; diff --git a/test_files/compile-tests/t01/t011/t0113/expected.xkb b/test_files/compile-tests/t01/t011/t0113/expected.xkb new file mode 100644 index 00000000..8826c1b5 --- /dev/null +++ b/test_files/compile-tests/t01/t011/t0113/expected.xkb @@ -0,0 +1,35 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ B ] + }; + }; +}; diff --git a/test_files/compile-tests/t01/t011/t0113/input.xkb b/test_files/compile-tests/t01/t011/t0113/input.xkb new file mode 100644 index 00000000..f7202239 --- /dev/null +++ b/test_files/compile-tests/t01/t011/t0113/input.xkb @@ -0,0 +1,9 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_symbols { + key { [ A ] }; + key { [ B ] }; + }; +}; diff --git a/test_files/compile-tests/t01/t011/t0114/expected.xkb b/test_files/compile-tests/t01/t011/t0114/expected.xkb new file mode 100644 index 00000000..0fc7cb8b --- /dev/null +++ b/test_files/compile-tests/t01/t011/t0114/expected.xkb @@ -0,0 +1,35 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ A ] + }; + }; +}; diff --git a/test_files/compile-tests/t01/t011/t0114/input.xkb b/test_files/compile-tests/t01/t011/t0114/input.xkb new file mode 100644 index 00000000..807713e4 --- /dev/null +++ b/test_files/compile-tests/t01/t011/t0114/input.xkb @@ -0,0 +1,9 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_symbols { + key { [ A ] }; + augment key { [ B ] }; + }; +}; diff --git a/test_files/compile-tests/t01/t011/t0115/expected.xkb b/test_files/compile-tests/t01/t011/t0115/expected.xkb new file mode 100644 index 00000000..8826c1b5 --- /dev/null +++ b/test_files/compile-tests/t01/t011/t0115/expected.xkb @@ -0,0 +1,35 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ B ] + }; + }; +}; diff --git a/test_files/compile-tests/t01/t011/t0115/input.xkb b/test_files/compile-tests/t01/t011/t0115/input.xkb new file mode 100644 index 00000000..23698f60 --- /dev/null +++ b/test_files/compile-tests/t01/t011/t0115/input.xkb @@ -0,0 +1,9 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_symbols { + key { [ A ] }; + replace key { [ B ] }; + }; +}; diff --git a/test_files/compile-tests/t01/t011/t0116/expected.xkb b/test_files/compile-tests/t01/t011/t0116/expected.xkb new file mode 100644 index 00000000..6ccb0c3f --- /dev/null +++ b/test_files/compile-tests/t01/t011/t0116/expected.xkb @@ -0,0 +1,35 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ C ] + }; + }; +}; diff --git a/test_files/compile-tests/t01/t011/t0116/input.xkb b/test_files/compile-tests/t01/t011/t0116/input.xkb new file mode 100644 index 00000000..76e5b075 --- /dev/null +++ b/test_files/compile-tests/t01/t011/t0116/input.xkb @@ -0,0 +1,9 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_symbols { + key { [ A ], [ B ] }; + replace key { [ C ] }; + }; +}; diff --git a/test_files/compile-tests/t01/t011/t0119/expected.xkb b/test_files/compile-tests/t01/t011/t0119/expected.xkb new file mode 100644 index 00000000..c98d9ce8 --- /dev/null +++ b/test_files/compile-tests/t01/t011/t0119/expected.xkb @@ -0,0 +1,37 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ALPHABETIC" { + modifiers = Shift+Lock; + level_name[Level1] = "Base"; + level_name[Level2] = "Caps"; + map[Shift] = Level2; + map[Lock] = Level2; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + type[Group1] = "ALPHABETIC", + symbols[Group1] = [ A ] + }; + }; +}; diff --git a/test_files/compile-tests/t01/t011/t0119/input.xkb b/test_files/compile-tests/t01/t011/t0119/input.xkb new file mode 100644 index 00000000..81bddbde --- /dev/null +++ b/test_files/compile-tests/t01/t011/t0119/input.xkb @@ -0,0 +1,15 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_symbols { + key { + type[Group1] = "TWO_LEVEL", + [ A ] + }; + key { + type[Group1] = "ALPHABETIC", + [ A ] + }; + }; +}; diff --git a/test_files/compile-tests/t01/t012/t0120/expected.xkb b/test_files/compile-tests/t01/t012/t0120/expected.xkb new file mode 100644 index 00000000..0fc7cb8b --- /dev/null +++ b/test_files/compile-tests/t01/t012/t0120/expected.xkb @@ -0,0 +1,35 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ A ] + }; + }; +}; diff --git a/test_files/compile-tests/t01/t012/t0120/input.xkb b/test_files/compile-tests/t01/t012/t0120/input.xkb new file mode 100644 index 00000000..6e641263 --- /dev/null +++ b/test_files/compile-tests/t01/t012/t0120/input.xkb @@ -0,0 +1,11 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_symbols { + key { }; + key { + [ A ] + }; + }; +}; diff --git a/test_files/compile-tests/t01/t012/t0126/expected.xkb b/test_files/compile-tests/t01/t012/t0126/expected.xkb new file mode 100644 index 00000000..a4fc06ee --- /dev/null +++ b/test_files/compile-tests/t01/t012/t0126/expected.xkb @@ -0,0 +1,22 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + name[Group1] = "X"; + }; +}; diff --git a/test_files/compile-tests/t01/t012/t0126/input.xkb b/test_files/compile-tests/t01/t012/t0126/input.xkb new file mode 100644 index 00000000..e7952c4e --- /dev/null +++ b/test_files/compile-tests/t01/t012/t0126/input.xkb @@ -0,0 +1,8 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_symbols { + augment name[Group1] = "X"; + }; +}; diff --git a/test_files/compile-tests/t01/t012/t0127/expected.xkb b/test_files/compile-tests/t01/t012/t0127/expected.xkb new file mode 100644 index 00000000..51349e47 --- /dev/null +++ b/test_files/compile-tests/t01/t012/t0127/expected.xkb @@ -0,0 +1,22 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + name[Group1] = "Y"; + }; +}; diff --git a/test_files/compile-tests/t01/t012/t0127/input.xkb b/test_files/compile-tests/t01/t012/t0127/input.xkb new file mode 100644 index 00000000..ef5aa913 --- /dev/null +++ b/test_files/compile-tests/t01/t012/t0127/input.xkb @@ -0,0 +1,9 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_symbols { + name[Group1] = "X"; + name[Group1] = "Y"; + }; +}; diff --git a/test_files/compile-tests/t01/t012/t0128/expected.xkb b/test_files/compile-tests/t01/t012/t0128/expected.xkb new file mode 100644 index 00000000..15cb3ea1 --- /dev/null +++ b/test_files/compile-tests/t01/t012/t0128/expected.xkb @@ -0,0 +1,32 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + = 2; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + repeat = false + }; + key { + repeat = false + }; + }; +}; diff --git a/test_files/compile-tests/t01/t012/t0128/input.xkb b/test_files/compile-tests/t01/t012/t0128/input.xkb new file mode 100644 index 00000000..3b46baf9 --- /dev/null +++ b/test_files/compile-tests/t01/t012/t0128/input.xkb @@ -0,0 +1,9 @@ +xkb_keymap { + xkb_keycodes { + = 1; + = 2; + }; + xkb_symbols { + include "x.xkb" + }; +}; diff --git a/test_files/compile-tests/t01/t012/t0128/symbols/x.xkb b/test_files/compile-tests/t01/t012/t0128/symbols/x.xkb new file mode 100644 index 00000000..d14e985f --- /dev/null +++ b/test_files/compile-tests/t01/t012/t0128/symbols/x.xkb @@ -0,0 +1,4 @@ +xkb_symbols { + key { }; + key { }; +}; diff --git a/test_files/compile-tests/t01/t012/t0129/expected.xkb b/test_files/compile-tests/t01/t012/t0129/expected.xkb new file mode 100644 index 00000000..67c4b947 --- /dev/null +++ b/test_files/compile-tests/t01/t012/t0129/expected.xkb @@ -0,0 +1,35 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + = 2; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + modmap Mod1 { }; + modmap Mod1 { }; + + key.repeat = true; + + key { + repeat = false + }; + key { + repeat = false + }; + }; +}; diff --git a/test_files/compile-tests/t01/t012/t0129/input.xkb b/test_files/compile-tests/t01/t012/t0129/input.xkb new file mode 100644 index 00000000..19250b44 --- /dev/null +++ b/test_files/compile-tests/t01/t012/t0129/input.xkb @@ -0,0 +1,12 @@ +xkb_keymap { + xkb_keycodes { + = 1; + = 2; + }; + xkb_symbols { + include "x.xkb" + + key { }; + key { }; + }; +}; diff --git a/test_files/compile-tests/t01/t012/t0129/symbols/x.xkb b/test_files/compile-tests/t01/t012/t0129/symbols/x.xkb new file mode 100644 index 00000000..9fc80d03 --- /dev/null +++ b/test_files/compile-tests/t01/t012/t0129/symbols/x.xkb @@ -0,0 +1,3 @@ +xkb_symbols { + modmap Mod1 { , }; +}; diff --git a/test_files/compile-tests/t01/t013/t0130/expected.xkb b/test_files/compile-tests/t01/t013/t0130/expected.xkb new file mode 100644 index 00000000..bc41561c --- /dev/null +++ b/test_files/compile-tests/t01/t013/t0130/expected.xkb @@ -0,0 +1,23 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + name[Group1] = "X"; + name[Group2] = "Y"; + }; +}; diff --git a/test_files/compile-tests/t01/t013/t0130/input.xkb b/test_files/compile-tests/t01/t013/t0130/input.xkb new file mode 100644 index 00000000..7ab57d56 --- /dev/null +++ b/test_files/compile-tests/t01/t013/t0130/input.xkb @@ -0,0 +1,5 @@ +xkb_keymap { + xkb_symbols { + include "x.xkb" + }; +}; diff --git a/test_files/compile-tests/t01/t013/t0130/symbols/x.xkb b/test_files/compile-tests/t01/t013/t0130/symbols/x.xkb new file mode 100644 index 00000000..d5498bf7 --- /dev/null +++ b/test_files/compile-tests/t01/t013/t0130/symbols/x.xkb @@ -0,0 +1,4 @@ +xkb_symbols { + name[Group1] = "X"; + name[Group2] = "Y"; +}; diff --git a/test_files/compile-tests/t01/t013/t0135/expected.xkb b/test_files/compile-tests/t01/t013/t0135/expected.xkb new file mode 100644 index 00000000..29f22589 --- /dev/null +++ b/test_files/compile-tests/t01/t013/t0135/expected.xkb @@ -0,0 +1,36 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + actions[Group1] = [ SetMods(modifiers = Mod1) ] + }; + }; +}; diff --git a/test_files/compile-tests/t01/t013/t0135/input.xkb b/test_files/compile-tests/t01/t013/t0135/input.xkb new file mode 100644 index 00000000..c46b5cdf --- /dev/null +++ b/test_files/compile-tests/t01/t013/t0135/input.xkb @@ -0,0 +1,11 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_symbols { + SetMods.mods = Mod1; + key { + [ SetMods() ] + }; + }; +}; diff --git a/test_files/compile-tests/t01/t013/t0137/expected.xkb b/test_files/compile-tests/t01/t013/t0137/expected.xkb new file mode 100644 index 00000000..c405ec7e --- /dev/null +++ b/test_files/compile-tests/t01/t013/t0137/expected.xkb @@ -0,0 +1,35 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "A" { + modifiers = None; + map[Mod1] = Level1; + map[Mod2] = Level2; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + type[Group1] = "A", + symbols[Group1] = [ A ] + }; + }; +}; diff --git a/test_files/compile-tests/t01/t013/t0137/input.xkb b/test_files/compile-tests/t01/t013/t0137/input.xkb new file mode 100644 index 00000000..bf57b57f --- /dev/null +++ b/test_files/compile-tests/t01/t013/t0137/input.xkb @@ -0,0 +1,17 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_types { + type "A" { + map[Mod2] = Level2; + map[Mod1] = Level1; + }; + }; + xkb_symbols { + key { + type = "A", + [ A ] + }; + }; +}; diff --git a/test_files/compile-tests/t01/t013/t0138/expected.xkb b/test_files/compile-tests/t01/t013/t0138/expected.xkb new file mode 100644 index 00000000..961c8f2f --- /dev/null +++ b/test_files/compile-tests/t01/t013/t0138/expected.xkb @@ -0,0 +1,21 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t01/t013/t0138/input.xkb b/test_files/compile-tests/t01/t013/t0138/input.xkb new file mode 100644 index 00000000..5618e1a9 --- /dev/null +++ b/test_files/compile-tests/t01/t013/t0138/input.xkb @@ -0,0 +1,8 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_symbols { + modmap Mod1 { }; + }; +}; diff --git a/test_files/compile-tests/t01/t015/t0153/expected.xkb b/test_files/compile-tests/t01/t015/t0153/expected.xkb new file mode 100644 index 00000000..98a072dc --- /dev/null +++ b/test_files/compile-tests/t01/t015/t0153/expected.xkb @@ -0,0 +1,35 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "X" { + modifiers = None; + map[Mod1] = Level2; + map[Mod3] = Level2; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + type[Group1] = "X", + symbols[Group1] = [ A ] + }; + }; +}; diff --git a/test_files/compile-tests/t01/t015/t0153/input.xkb b/test_files/compile-tests/t01/t015/t0153/input.xkb new file mode 100644 index 00000000..1b5364f1 --- /dev/null +++ b/test_files/compile-tests/t01/t015/t0153/input.xkb @@ -0,0 +1,16 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_types { + type "X" { + map[Mod1] = --------------2; + map[Mod2] = ----------------2; + map[Mod3] = (((((((((((((((2))))))))))))))); + map[Mod4] = ((((((((((((((((2)))))))))))))))); + }; + }; + xkb_symbols { + key { type = "X", [ A ] }; + }; +}; diff --git a/test_files/compile-tests/t02/t025/t0252/expected.xkb b/test_files/compile-tests/t02/t025/t0252/expected.xkb new file mode 100644 index 00000000..73cfe165 --- /dev/null +++ b/test_files/compile-tests/t02/t025/t0252/expected.xkb @@ -0,0 +1,35 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 2; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ A ] + }; + }; +}; diff --git a/test_files/compile-tests/t02/t025/t0252/input.xkb b/test_files/compile-tests/t02/t025/t0252/input.xkb new file mode 100644 index 00000000..004a0887 --- /dev/null +++ b/test_files/compile-tests/t02/t025/t0252/input.xkb @@ -0,0 +1,8 @@ +xkb_keymap { + xkb_keycodes { + include "a.xkb" + }; + xkb_symbols { + key { [ A ] }; + }; +}; diff --git a/test_files/compile-tests/t02/t025/t0252/keycodes/a.xkb b/test_files/compile-tests/t02/t025/t0252/keycodes/a.xkb new file mode 100644 index 00000000..e7444f4c --- /dev/null +++ b/test_files/compile-tests/t02/t025/t0252/keycodes/a.xkb @@ -0,0 +1,7 @@ +partial xkb_keycodes { + = 1; +}; + +default xkb_keycodes { + = 2; +}; diff --git a/test_files/compile-tests/t02/t025/t0253/expected.xkb b/test_files/compile-tests/t02/t025/t0253/expected.xkb new file mode 100644 index 00000000..73cfe165 --- /dev/null +++ b/test_files/compile-tests/t02/t025/t0253/expected.xkb @@ -0,0 +1,35 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 2; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ A ] + }; + }; +}; diff --git a/test_files/compile-tests/t02/t025/t0253/input.xkb b/test_files/compile-tests/t02/t025/t0253/input.xkb new file mode 100644 index 00000000..004a0887 --- /dev/null +++ b/test_files/compile-tests/t02/t025/t0253/input.xkb @@ -0,0 +1,8 @@ +xkb_keymap { + xkb_keycodes { + include "a.xkb" + }; + xkb_symbols { + key { [ A ] }; + }; +}; diff --git a/test_files/compile-tests/t02/t025/t0253/keycodes/a.xkb b/test_files/compile-tests/t02/t025/t0253/keycodes/a.xkb new file mode 100644 index 00000000..1e3df62d --- /dev/null +++ b/test_files/compile-tests/t02/t025/t0253/keycodes/a.xkb @@ -0,0 +1,3 @@ +default XkB_kEyCoDeS { + = 2; +}; diff --git a/test_files/compile-tests/t02/t025/t0254/compat/a.xkb b/test_files/compile-tests/t02/t025/t0254/compat/a.xkb new file mode 100644 index 00000000..6825e371 --- /dev/null +++ b/test_files/compile-tests/t02/t025/t0254/compat/a.xkb @@ -0,0 +1,3 @@ +xkb_compatibility_map { + indicator "Caps Lock" { }; +}; diff --git a/test_files/compile-tests/t02/t025/t0254/expected.xkb b/test_files/compile-tests/t02/t025/t0254/expected.xkb new file mode 100644 index 00000000..20bbc081 --- /dev/null +++ b/test_files/compile-tests/t02/t025/t0254/expected.xkb @@ -0,0 +1,21 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + virtual indicator 1 = "Caps Lock"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t02/t025/t0254/input.xkb b/test_files/compile-tests/t02/t025/t0254/input.xkb new file mode 100644 index 00000000..f820c8b7 --- /dev/null +++ b/test_files/compile-tests/t02/t025/t0254/input.xkb @@ -0,0 +1,5 @@ +xkb_keymap { + xkb_compat { + include "a.xkb" + }; +}; diff --git a/test_files/compile-tests/t02/t025/t0255/compat/a.xkb b/test_files/compile-tests/t02/t025/t0255/compat/a.xkb new file mode 100644 index 00000000..61786172 --- /dev/null +++ b/test_files/compile-tests/t02/t025/t0255/compat/a.xkb @@ -0,0 +1,3 @@ +xkb_compat_map { + indicator "Caps Lock" { }; +}; diff --git a/test_files/compile-tests/t02/t025/t0255/expected.xkb b/test_files/compile-tests/t02/t025/t0255/expected.xkb new file mode 100644 index 00000000..20bbc081 --- /dev/null +++ b/test_files/compile-tests/t02/t025/t0255/expected.xkb @@ -0,0 +1,21 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + virtual indicator 1 = "Caps Lock"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t02/t025/t0255/input.xkb b/test_files/compile-tests/t02/t025/t0255/input.xkb new file mode 100644 index 00000000..f820c8b7 --- /dev/null +++ b/test_files/compile-tests/t02/t025/t0255/input.xkb @@ -0,0 +1,5 @@ +xkb_keymap { + xkb_compat { + include "a.xkb" + }; +}; diff --git a/test_files/compile-tests/t02/t025/t0256/expected.xkb b/test_files/compile-tests/t02/t025/t0256/expected.xkb new file mode 100644 index 00000000..961c8f2f --- /dev/null +++ b/test_files/compile-tests/t02/t025/t0256/expected.xkb @@ -0,0 +1,21 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t02/t025/t0256/input.xkb b/test_files/compile-tests/t02/t025/t0256/input.xkb new file mode 100644 index 00000000..ef2bb43c --- /dev/null +++ b/test_files/compile-tests/t02/t025/t0256/input.xkb @@ -0,0 +1 @@ +xkb_semantics { }; diff --git a/test_files/compile-tests/t02/t025/t0257/expected.xkb b/test_files/compile-tests/t02/t025/t0257/expected.xkb new file mode 100644 index 00000000..961c8f2f --- /dev/null +++ b/test_files/compile-tests/t02/t025/t0257/expected.xkb @@ -0,0 +1,21 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t02/t025/t0257/input.xkb b/test_files/compile-tests/t02/t025/t0257/input.xkb new file mode 100644 index 00000000..a671681e --- /dev/null +++ b/test_files/compile-tests/t02/t025/t0257/input.xkb @@ -0,0 +1 @@ +xkb_layout { }; diff --git a/test_files/compile-tests/t02/t025/t0258/expected.xkb b/test_files/compile-tests/t02/t025/t0258/expected.xkb new file mode 100644 index 00000000..c2e43653 --- /dev/null +++ b/test_files/compile-tests/t02/t025/t0258/expected.xkb @@ -0,0 +1,21 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "A"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t02/t025/t0258/input.xkb b/test_files/compile-tests/t02/t025/t0258/input.xkb new file mode 100644 index 00000000..9a546b8a --- /dev/null +++ b/test_files/compile-tests/t02/t025/t0258/input.xkb @@ -0,0 +1,5 @@ +xkb_keymap { + xkb_KEYCODES { + indicator 1 = "A"; + }; +}; diff --git a/test_files/compile-tests/t02/t025/t0259/expected.xkb b/test_files/compile-tests/t02/t025/t0259/expected.xkb new file mode 100644 index 00000000..0fc7cb8b --- /dev/null +++ b/test_files/compile-tests/t02/t025/t0259/expected.xkb @@ -0,0 +1,35 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ A ] + }; + }; +}; diff --git a/test_files/compile-tests/t02/t025/t0259/input.xkb b/test_files/compile-tests/t02/t025/t0259/input.xkb new file mode 100644 index 00000000..004a0887 --- /dev/null +++ b/test_files/compile-tests/t02/t025/t0259/input.xkb @@ -0,0 +1,8 @@ +xkb_keymap { + xkb_keycodes { + include "a.xkb" + }; + xkb_symbols { + key { [ A ] }; + }; +}; diff --git a/test_files/compile-tests/t02/t025/t0259/keycodes/a.xkb b/test_files/compile-tests/t02/t025/t0259/keycodes/a.xkb new file mode 100644 index 00000000..a4f4bb1d --- /dev/null +++ b/test_files/compile-tests/t02/t025/t0259/keycodes/a.xkb @@ -0,0 +1,3 @@ +DEFAULT xkb_keycodes { + = 1; +}; diff --git a/test_files/compile-tests/t02/t026/t0262/expected.xkb b/test_files/compile-tests/t02/t026/t0262/expected.xkb new file mode 100644 index 00000000..067ef97c --- /dev/null +++ b/test_files/compile-tests/t02/t026/t0262/expected.xkb @@ -0,0 +1,21 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + virtual indicator 1 = "A"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t02/t026/t0262/input.xkb b/test_files/compile-tests/t02/t026/t0262/input.xkb new file mode 100644 index 00000000..d5195a7a --- /dev/null +++ b/test_files/compile-tests/t02/t026/t0262/input.xkb @@ -0,0 +1,5 @@ +xkb_keymap { + xkb_keycodes { + virtual INDICATOR 1 = "A"; + }; +}; diff --git a/test_files/compile-tests/t02/t026/t0266/expected.xkb b/test_files/compile-tests/t02/t026/t0266/expected.xkb new file mode 100644 index 00000000..cb7bbfa1 --- /dev/null +++ b/test_files/compile-tests/t02/t026/t0266/expected.xkb @@ -0,0 +1,21 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "B"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t02/t026/t0266/input.xkb b/test_files/compile-tests/t02/t026/t0266/input.xkb new file mode 100644 index 00000000..50efe780 --- /dev/null +++ b/test_files/compile-tests/t02/t026/t0266/input.xkb @@ -0,0 +1,6 @@ +xkb_keymap { + xkb_keycodes { + indicator 1 = "A"; + alternate indicator 1 = "B"; + }; +}; diff --git a/test_files/compile-tests/t02/t026/t0268/expected.xkb b/test_files/compile-tests/t02/t026/t0268/expected.xkb new file mode 100644 index 00000000..d1332d78 --- /dev/null +++ b/test_files/compile-tests/t02/t026/t0268/expected.xkb @@ -0,0 +1,22 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + name[Group3] = "3"; + }; +}; diff --git a/test_files/compile-tests/t02/t026/t0268/input.xkb b/test_files/compile-tests/t02/t026/t0268/input.xkb new file mode 100644 index 00000000..f7c32b6e --- /dev/null +++ b/test_files/compile-tests/t02/t026/t0268/input.xkb @@ -0,0 +1,5 @@ +xkb_keymap { + xkb_symbols { + name[5 - 1 - 1] = "3"; + }; +}; diff --git a/test_files/compile-tests/t02/t026/t0269/expected.xkb b/test_files/compile-tests/t02/t026/t0269/expected.xkb new file mode 100644 index 00000000..11341a52 --- /dev/null +++ b/test_files/compile-tests/t02/t026/t0269/expected.xkb @@ -0,0 +1,22 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + name[Group2] = "2"; + }; +}; diff --git a/test_files/compile-tests/t02/t026/t0269/input.xkb b/test_files/compile-tests/t02/t026/t0269/input.xkb new file mode 100644 index 00000000..9ee9bb9c --- /dev/null +++ b/test_files/compile-tests/t02/t026/t0269/input.xkb @@ -0,0 +1,5 @@ +xkb_keymap { + xkb_symbols { + name[8 / 2 / 2] = "2"; + }; +}; diff --git a/test_files/compile-tests/t02/t027/t0274/expected.xkb b/test_files/compile-tests/t02/t027/t0274/expected.xkb new file mode 100644 index 00000000..2c98f0cd --- /dev/null +++ b/test_files/compile-tests/t02/t027/t0274/expected.xkb @@ -0,0 +1,22 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "A"; + indicator 2 = "B"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t02/t027/t0274/extra-includes/keycodes/x.xkb b/test_files/compile-tests/t02/t027/t0274/extra-includes/keycodes/x.xkb new file mode 100644 index 00000000..30921a42 --- /dev/null +++ b/test_files/compile-tests/t02/t027/t0274/extra-includes/keycodes/x.xkb @@ -0,0 +1,3 @@ +xkb_keycodes "b" { + indicator 2 = "B"; +}; diff --git a/test_files/compile-tests/t02/t027/t0274/input.xkb b/test_files/compile-tests/t02/t027/t0274/input.xkb new file mode 100644 index 00000000..3575080d --- /dev/null +++ b/test_files/compile-tests/t02/t027/t0274/input.xkb @@ -0,0 +1,6 @@ +xkb_keymap { + xkb_keycodes { + include "x.xkb(a)" + include "x.xkb(b)" + }; +}; diff --git a/test_files/compile-tests/t02/t027/t0274/keycodes/x.xkb b/test_files/compile-tests/t02/t027/t0274/keycodes/x.xkb new file mode 100644 index 00000000..276a01b0 --- /dev/null +++ b/test_files/compile-tests/t02/t027/t0274/keycodes/x.xkb @@ -0,0 +1,3 @@ +xkb_keycodes "a" { + indicator 1 = "A"; +}; diff --git a/test_files/compile-tests/t02/t027/t0275/expected.xkb b/test_files/compile-tests/t02/t027/t0275/expected.xkb new file mode 100644 index 00000000..05c453d4 --- /dev/null +++ b/test_files/compile-tests/t02/t027/t0275/expected.xkb @@ -0,0 +1,21 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 2 = "B"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t02/t027/t0275/extra-includes/keycodes/x.xkb b/test_files/compile-tests/t02/t027/t0275/extra-includes/keycodes/x.xkb new file mode 100644 index 00000000..e9f8b825 --- /dev/null +++ b/test_files/compile-tests/t02/t027/t0275/extra-includes/keycodes/x.xkb @@ -0,0 +1,3 @@ +default xkb_keycodes { + indicator 2 = "B"; +}; diff --git a/test_files/compile-tests/t02/t027/t0275/input.xkb b/test_files/compile-tests/t02/t027/t0275/input.xkb new file mode 100644 index 00000000..e9e7fbf5 --- /dev/null +++ b/test_files/compile-tests/t02/t027/t0275/input.xkb @@ -0,0 +1,5 @@ +xkb_keymap { + xkb_keycodes { + include "x.xkb" + }; +}; diff --git a/test_files/compile-tests/t02/t027/t0275/keycodes/x.xkb b/test_files/compile-tests/t02/t027/t0275/keycodes/x.xkb new file mode 100644 index 00000000..276a01b0 --- /dev/null +++ b/test_files/compile-tests/t02/t027/t0275/keycodes/x.xkb @@ -0,0 +1,3 @@ +xkb_keycodes "a" { + indicator 1 = "A"; +}; diff --git a/test_files/compile-tests/t02/t027/t0276/expected.xkb b/test_files/compile-tests/t02/t027/t0276/expected.xkb new file mode 100644 index 00000000..cb7bbfa1 --- /dev/null +++ b/test_files/compile-tests/t02/t027/t0276/expected.xkb @@ -0,0 +1,21 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "B"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t02/t027/t0276/input.xkb b/test_files/compile-tests/t02/t027/t0276/input.xkb new file mode 100644 index 00000000..43327708 --- /dev/null +++ b/test_files/compile-tests/t02/t027/t0276/input.xkb @@ -0,0 +1,7 @@ +xkb_keymap { + xkb_keycodes { + indicator 1 = "A"; + augment "x.xkb" + replace "x.xkb" + }; +}; diff --git a/test_files/compile-tests/t02/t027/t0276/keycodes/x.xkb b/test_files/compile-tests/t02/t027/t0276/keycodes/x.xkb new file mode 100644 index 00000000..d5bdda8e --- /dev/null +++ b/test_files/compile-tests/t02/t027/t0276/keycodes/x.xkb @@ -0,0 +1,3 @@ +xkb_keycodes "a" { + indicator 1 = "B"; +}; diff --git a/test_files/compile-tests/t02/t027/t0278/expected.xkb b/test_files/compile-tests/t02/t027/t0278/expected.xkb new file mode 100644 index 00000000..cb7bbfa1 --- /dev/null +++ b/test_files/compile-tests/t02/t027/t0278/expected.xkb @@ -0,0 +1,21 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "B"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t02/t027/t0278/input.xkb b/test_files/compile-tests/t02/t027/t0278/input.xkb new file mode 100644 index 00000000..9063bb7c --- /dev/null +++ b/test_files/compile-tests/t02/t027/t0278/input.xkb @@ -0,0 +1,7 @@ +xkb_keymap { + xkb_keycodes { + indicator 1 = "A"; + augment "x.xkb(a)" + replace "x.xkb(a)" + }; +}; diff --git a/test_files/compile-tests/t02/t027/t0278/keycodes/x.xkb b/test_files/compile-tests/t02/t027/t0278/keycodes/x.xkb new file mode 100644 index 00000000..d5bdda8e --- /dev/null +++ b/test_files/compile-tests/t02/t027/t0278/keycodes/x.xkb @@ -0,0 +1,3 @@ +xkb_keycodes "a" { + indicator 1 = "B"; +}; diff --git a/test_files/compile-tests/t02/t028/t0282/expected.xkb b/test_files/compile-tests/t02/t028/t0282/expected.xkb new file mode 100644 index 00000000..cb7bbfa1 --- /dev/null +++ b/test_files/compile-tests/t02/t028/t0282/expected.xkb @@ -0,0 +1,21 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "B"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t02/t028/t0282/input.xkb b/test_files/compile-tests/t02/t028/t0282/input.xkb new file mode 100644 index 00000000..43327708 --- /dev/null +++ b/test_files/compile-tests/t02/t028/t0282/input.xkb @@ -0,0 +1,7 @@ +xkb_keymap { + xkb_keycodes { + indicator 1 = "A"; + augment "x.xkb" + replace "x.xkb" + }; +}; diff --git a/test_files/compile-tests/t02/t028/t0282/keycodes/x.xkb b/test_files/compile-tests/t02/t028/t0282/keycodes/x.xkb new file mode 100644 index 00000000..9e1c4330 --- /dev/null +++ b/test_files/compile-tests/t02/t028/t0282/keycodes/x.xkb @@ -0,0 +1,6 @@ +xkb_keycodes "dummy" { +}; + +default xkb_keycodes { + indicator 1 = "B"; +}; diff --git a/test_files/compile-tests/t02/t028/t0283/expected.xkb b/test_files/compile-tests/t02/t028/t0283/expected.xkb new file mode 100644 index 00000000..cb7bbfa1 --- /dev/null +++ b/test_files/compile-tests/t02/t028/t0283/expected.xkb @@ -0,0 +1,21 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "B"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t02/t028/t0283/input.xkb b/test_files/compile-tests/t02/t028/t0283/input.xkb new file mode 100644 index 00000000..1f02bf4a --- /dev/null +++ b/test_files/compile-tests/t02/t028/t0283/input.xkb @@ -0,0 +1,6 @@ +xkb_keymap { + xkb_keycodes { + indicator 1 = "A"; + replace "x.xkb" + }; +}; diff --git a/test_files/compile-tests/t02/t028/t0283/keycodes/x.xkb b/test_files/compile-tests/t02/t028/t0283/keycodes/x.xkb new file mode 100644 index 00000000..e5e9f7f4 --- /dev/null +++ b/test_files/compile-tests/t02/t028/t0283/keycodes/x.xkb @@ -0,0 +1,7 @@ +xkb_keycodes "" { + indicator 1 = "C"; +}; + +default xkb_keycodes { + indicator 1 = "B"; +}; diff --git a/test_files/compile-tests/t02/t028/t0284/expected.xkb b/test_files/compile-tests/t02/t028/t0284/expected.xkb new file mode 100644 index 00000000..b310a5e8 --- /dev/null +++ b/test_files/compile-tests/t02/t028/t0284/expected.xkb @@ -0,0 +1,21 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "C"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t02/t028/t0284/input.xkb b/test_files/compile-tests/t02/t028/t0284/input.xkb new file mode 100644 index 00000000..bc7d96e2 --- /dev/null +++ b/test_files/compile-tests/t02/t028/t0284/input.xkb @@ -0,0 +1,6 @@ +xkb_keymap { + xkb_keycodes { + indicator 1 = "A"; + replace "x.xkb()" + }; +}; diff --git a/test_files/compile-tests/t02/t028/t0284/keycodes/x.xkb b/test_files/compile-tests/t02/t028/t0284/keycodes/x.xkb new file mode 100644 index 00000000..e5e9f7f4 --- /dev/null +++ b/test_files/compile-tests/t02/t028/t0284/keycodes/x.xkb @@ -0,0 +1,7 @@ +xkb_keycodes "" { + indicator 1 = "C"; +}; + +default xkb_keycodes { + indicator 1 = "B"; +}; diff --git a/test_files/compile-tests/t02/t028/t0285/expected.xkb b/test_files/compile-tests/t02/t028/t0285/expected.xkb new file mode 100644 index 00000000..961c8f2f --- /dev/null +++ b/test_files/compile-tests/t02/t028/t0285/expected.xkb @@ -0,0 +1,21 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t02/t028/t0285/input.xkb b/test_files/compile-tests/t02/t028/t0285/input.xkb new file mode 100644 index 00000000..f4ba6bf8 --- /dev/null +++ b/test_files/compile-tests/t02/t028/t0285/input.xkb @@ -0,0 +1,5 @@ +xkb_keymap { + xkb_keycodes { + replace "(" + }; +}; diff --git a/test_files/compile-tests/t02/t028/t0287/expected.xkb b/test_files/compile-tests/t02/t028/t0287/expected.xkb new file mode 100644 index 00000000..c2e43653 --- /dev/null +++ b/test_files/compile-tests/t02/t028/t0287/expected.xkb @@ -0,0 +1,21 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "A"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t02/t028/t0287/input.xkb b/test_files/compile-tests/t02/t028/t0287/input.xkb new file mode 100644 index 00000000..e9e7fbf5 --- /dev/null +++ b/test_files/compile-tests/t02/t028/t0287/input.xkb @@ -0,0 +1,5 @@ +xkb_keymap { + xkb_keycodes { + include "x.xkb" + }; +}; diff --git a/test_files/compile-tests/t02/t028/t0287/keycodes/x.xkb b/test_files/compile-tests/t02/t028/t0287/keycodes/x.xkb new file mode 100644 index 00000000..dc4da73a --- /dev/null +++ b/test_files/compile-tests/t02/t028/t0287/keycodes/x.xkb @@ -0,0 +1,3 @@ +default xkb_keycodes { + include "y.xkb" +}; diff --git a/test_files/compile-tests/t02/t028/t0287/keycodes/y.xkb b/test_files/compile-tests/t02/t028/t0287/keycodes/y.xkb new file mode 100644 index 00000000..b01eebad --- /dev/null +++ b/test_files/compile-tests/t02/t028/t0287/keycodes/y.xkb @@ -0,0 +1,3 @@ +default xkb_keycodes { + indicator 1 = "A"; +}; diff --git a/test_files/compile-tests/t02/t028/t0288/expected.xkb b/test_files/compile-tests/t02/t028/t0288/expected.xkb new file mode 100644 index 00000000..cb7bbfa1 --- /dev/null +++ b/test_files/compile-tests/t02/t028/t0288/expected.xkb @@ -0,0 +1,21 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "B"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t02/t028/t0288/input.xkb b/test_files/compile-tests/t02/t028/t0288/input.xkb new file mode 100644 index 00000000..8a89580e --- /dev/null +++ b/test_files/compile-tests/t02/t028/t0288/input.xkb @@ -0,0 +1,8 @@ +xkb_keymap { + xkb_keycodes { + indicator 1 = "A"; + }; + xkb_keycodes { + indicator 1 = "B"; + }; +}; diff --git a/test_files/compile-tests/t02/t028/t0289/expected.xkb b/test_files/compile-tests/t02/t028/t0289/expected.xkb new file mode 100644 index 00000000..c2e43653 --- /dev/null +++ b/test_files/compile-tests/t02/t028/t0289/expected.xkb @@ -0,0 +1,21 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "A"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t02/t028/t0289/input.xkb b/test_files/compile-tests/t02/t028/t0289/input.xkb new file mode 100644 index 00000000..21a929f5 --- /dev/null +++ b/test_files/compile-tests/t02/t028/t0289/input.xkb @@ -0,0 +1,8 @@ +xkb_keymap { + xkb_keycodes { + indicator 1 = "A"; + }; + xkb_keycodes { + augment indicator 1 = "B"; + }; +}; diff --git a/test_files/compile-tests/t02/t029/t0290/expected.xkb b/test_files/compile-tests/t02/t029/t0290/expected.xkb new file mode 100644 index 00000000..5dd7521e --- /dev/null +++ b/test_files/compile-tests/t02/t029/t0290/expected.xkb @@ -0,0 +1,25 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + virtual indicator 1 = "Caps Lock"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + indicator "Caps Lock" { + groups = 0x00000001; + }; + + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t02/t029/t0290/input.xkb b/test_files/compile-tests/t02/t029/t0290/input.xkb new file mode 100644 index 00000000..9bf11a09 --- /dev/null +++ b/test_files/compile-tests/t02/t029/t0290/input.xkb @@ -0,0 +1,7 @@ +xkb_keymap { + xkb_compat { + indicator "Caps Lock" { + groups=None+1; + }; + }; +}; diff --git a/test_files/compile-tests/t02/t029/t0291/expected.xkb b/test_files/compile-tests/t02/t029/t0291/expected.xkb new file mode 100644 index 00000000..01c2a5e9 --- /dev/null +++ b/test_files/compile-tests/t02/t029/t0291/expected.xkb @@ -0,0 +1,25 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + virtual indicator 1 = "Caps Lock"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + indicator "Caps Lock" { + controls = SlowKeys+MouseKeys; + }; + + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t02/t029/t0291/input.xkb b/test_files/compile-tests/t02/t029/t0291/input.xkb new file mode 100644 index 00000000..eef0b73e --- /dev/null +++ b/test_files/compile-tests/t02/t029/t0291/input.xkb @@ -0,0 +1,7 @@ +xkb_keymap { + xkb_compat { + indicator "Caps Lock" { + controls = SlowKeys + MouseKeys; + }; + }; +}; diff --git a/test_files/compile-tests/t02/t029/t0292/expected.xkb b/test_files/compile-tests/t02/t029/t0292/expected.xkb new file mode 100644 index 00000000..564ad9ec --- /dev/null +++ b/test_files/compile-tests/t02/t029/t0292/expected.xkb @@ -0,0 +1,26 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + virtual indicator 1 = "Caps Lock"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + indicator "Caps Lock" { + modifiers = Mod1; + whichModState = Latched+Locked; + }; + + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t02/t029/t0292/input.xkb b/test_files/compile-tests/t02/t029/t0292/input.xkb new file mode 100644 index 00000000..b468bbbb --- /dev/null +++ b/test_files/compile-tests/t02/t029/t0292/input.xkb @@ -0,0 +1,8 @@ +xkb_keymap { + xkb_compat { + indicator "Caps Lock" { + mods = Mod1; + whichmodstate = Latched + Locked; + }; + }; +}; diff --git a/test_files/compile-tests/t02/t029/t0296/expected.xkb b/test_files/compile-tests/t02/t029/t0296/expected.xkb new file mode 100644 index 00000000..5dd7521e --- /dev/null +++ b/test_files/compile-tests/t02/t029/t0296/expected.xkb @@ -0,0 +1,25 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + virtual indicator 1 = "Caps Lock"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + indicator "Caps Lock" { + groups = 0x00000001; + }; + + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t02/t029/t0296/input.xkb b/test_files/compile-tests/t02/t029/t0296/input.xkb new file mode 100644 index 00000000..58bcdb79 --- /dev/null +++ b/test_files/compile-tests/t02/t029/t0296/input.xkb @@ -0,0 +1,7 @@ +xkb_keymap { + xkb_compat { + indicator "Caps Lock" { + groups=GROUP1; + }; + }; +}; diff --git a/test_files/compile-tests/t03/t031/t0310/expected.xkb b/test_files/compile-tests/t03/t031/t0310/expected.xkb new file mode 100644 index 00000000..b3f4117a --- /dev/null +++ b/test_files/compile-tests/t03/t031/t0310/expected.xkb @@ -0,0 +1,37 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ A ], + actions[Group1] = [ SetMods(modifiers = Mod1) ] + }; + }; +}; diff --git a/test_files/compile-tests/t03/t031/t0310/input.xkb b/test_files/compile-tests/t03/t031/t0310/input.xkb new file mode 100644 index 00000000..e094518f --- /dev/null +++ b/test_files/compile-tests/t03/t031/t0310/input.xkb @@ -0,0 +1,16 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret noSymbol + NoneOf(Mod1) { + action = SetMods(mods = Mod1); + }; + interpret noSymbol + NoneOf(Mod2) { + action = SetMods(mods = Mod2); + }; + }; + xkb_symbols { + key { [ A ] }; + }; +}; diff --git a/test_files/compile-tests/t03/t031/t0311/expected.xkb b/test_files/compile-tests/t03/t031/t0311/expected.xkb new file mode 100644 index 00000000..e751d2cd --- /dev/null +++ b/test_files/compile-tests/t03/t031/t0311/expected.xkb @@ -0,0 +1,37 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ VoidSymbol ], + actions[Group1] = [ SetMods(modifiers = Mod1) ] + }; + }; +}; diff --git a/test_files/compile-tests/t03/t031/t0311/input.xkb b/test_files/compile-tests/t03/t031/t0311/input.xkb new file mode 100644 index 00000000..584fc9bc --- /dev/null +++ b/test_files/compile-tests/t03/t031/t0311/input.xkb @@ -0,0 +1,13 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret none + NoneOf(Mod1) { + action = SetMods(mods = Mod1); + }; + }; + xkb_symbols { + key { [ none ] }; + }; +}; diff --git a/test_files/compile-tests/t03/t031/t0312/expected.xkb b/test_files/compile-tests/t03/t031/t0312/expected.xkb new file mode 100644 index 00000000..e751d2cd --- /dev/null +++ b/test_files/compile-tests/t03/t031/t0312/expected.xkb @@ -0,0 +1,37 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ VoidSymbol ], + actions[Group1] = [ SetMods(modifiers = Mod1) ] + }; + }; +}; diff --git a/test_files/compile-tests/t03/t031/t0312/input.xkb b/test_files/compile-tests/t03/t031/t0312/input.xkb new file mode 100644 index 00000000..7ffa8320 --- /dev/null +++ b/test_files/compile-tests/t03/t031/t0312/input.xkb @@ -0,0 +1,13 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret voidsymbol + NoneOf(Mod1) { + action = SetMods(mods = Mod1); + }; + }; + xkb_symbols { + key { [ none ] }; + }; +}; diff --git a/test_files/compile-tests/t03/t033/t0337/expected.xkb b/test_files/compile-tests/t03/t033/t0337/expected.xkb new file mode 100644 index 00000000..8deb8cfc --- /dev/null +++ b/test_files/compile-tests/t03/t033/t0337/expected.xkb @@ -0,0 +1,38 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers A = Mod1; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + modmap Mod1 { }; + + key.repeat = true; + + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ A ] + }; + }; +}; diff --git a/test_files/compile-tests/t03/t033/t0337/input.xkb b/test_files/compile-tests/t03/t033/t0337/input.xkb new file mode 100644 index 00000000..a5bdf350 --- /dev/null +++ b/test_files/compile-tests/t03/t033/t0337/input.xkb @@ -0,0 +1,16 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + virtual_modifiers A; + + interpret any { + virtualmod = A; + }; + }; + xkb_symbols { + key { [ A ] }; + modmap Mod1 { }; + }; +}; diff --git a/test_files/compile-tests/t03/t033/t0339/expected.xkb b/test_files/compile-tests/t03/t033/t0339/expected.xkb new file mode 100644 index 00000000..6047ddd7 --- /dev/null +++ b/test_files/compile-tests/t03/t033/t0339/expected.xkb @@ -0,0 +1,38 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "TWO_LEVEL" { + modifiers = Shift; + level_name[Level1] = "Base"; + level_name[Level2] = "Shift"; + map[Shift] = Level2; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + modmap Mod1 { }; + + key.repeat = true; + + key { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ B, A ] + }; + }; +}; diff --git a/test_files/compile-tests/t03/t033/t0339/input.xkb b/test_files/compile-tests/t03/t033/t0339/input.xkb new file mode 100644 index 00000000..5de963a2 --- /dev/null +++ b/test_files/compile-tests/t03/t033/t0339/input.xkb @@ -0,0 +1,16 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret.action = SetMods(mods = Mod2); + interpret A + Mod1 { + action = SetMods(mods = Mod1); + usemodmap = levelone; + }; + }; + xkb_symbols { + key { [ B, A ] }; + modmap Mod1 { }; + }; +}; diff --git a/test_files/compile-tests/t03/t034/t0340/expected.xkb b/test_files/compile-tests/t03/t034/t0340/expected.xkb new file mode 100644 index 00000000..6047ddd7 --- /dev/null +++ b/test_files/compile-tests/t03/t034/t0340/expected.xkb @@ -0,0 +1,38 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "TWO_LEVEL" { + modifiers = Shift; + level_name[Level1] = "Base"; + level_name[Level2] = "Shift"; + map[Shift] = Level2; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + modmap Mod1 { }; + + key.repeat = true; + + key { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ B, A ] + }; + }; +}; diff --git a/test_files/compile-tests/t03/t034/t0340/input.xkb b/test_files/compile-tests/t03/t034/t0340/input.xkb new file mode 100644 index 00000000..b6d85086 --- /dev/null +++ b/test_files/compile-tests/t03/t034/t0340/input.xkb @@ -0,0 +1,16 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret.action = SetMods(mods = Mod2); + interpret A + Mod1 { + action = SetMods(mods = Mod1); + usemodmap = level1; + }; + }; + xkb_symbols { + key { [ B, A ] }; + modmap Mod1 { }; + }; +}; diff --git a/test_files/compile-tests/t03/t034/t0341/expected.xkb b/test_files/compile-tests/t03/t034/t0341/expected.xkb new file mode 100644 index 00000000..bfd976f2 --- /dev/null +++ b/test_files/compile-tests/t03/t034/t0341/expected.xkb @@ -0,0 +1,39 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "TWO_LEVEL" { + modifiers = Shift; + level_name[Level1] = "Base"; + level_name[Level2] = "Shift"; + map[Shift] = Level2; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + modmap Mod1 { }; + + key.repeat = true; + + key { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ B, A ], + actions[Group1] = [ NoAction(), SetMods(modifiers = Mod1) ] + }; + }; +}; diff --git a/test_files/compile-tests/t03/t034/t0341/input.xkb b/test_files/compile-tests/t03/t034/t0341/input.xkb new file mode 100644 index 00000000..8b4d1634 --- /dev/null +++ b/test_files/compile-tests/t03/t034/t0341/input.xkb @@ -0,0 +1,17 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret.action = SetMods(mods = Mod2); + interpret.usemodmap = level1; + interpret A + Mod1 { + action = SetMods(mods = Mod1); + usemodmap = any; + }; + }; + xkb_symbols { + key { [ B, A ] }; + modmap Mod1 { }; + }; +}; diff --git a/test_files/compile-tests/t03/t034/t0342/expected.xkb b/test_files/compile-tests/t03/t034/t0342/expected.xkb new file mode 100644 index 00000000..bfd976f2 --- /dev/null +++ b/test_files/compile-tests/t03/t034/t0342/expected.xkb @@ -0,0 +1,39 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "TWO_LEVEL" { + modifiers = Shift; + level_name[Level1] = "Base"; + level_name[Level2] = "Shift"; + map[Shift] = Level2; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + modmap Mod1 { }; + + key.repeat = true; + + key { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ B, A ], + actions[Group1] = [ NoAction(), SetMods(modifiers = Mod1) ] + }; + }; +}; diff --git a/test_files/compile-tests/t03/t034/t0342/input.xkb b/test_files/compile-tests/t03/t034/t0342/input.xkb new file mode 100644 index 00000000..05b5dc54 --- /dev/null +++ b/test_files/compile-tests/t03/t034/t0342/input.xkb @@ -0,0 +1,17 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret.action = SetMods(mods = Mod2); + interpret.usemodmap = level1; + interpret A + Mod1 { + action = SetMods(mods = Mod1); + usemodmap = anylevel; + }; + }; + xkb_symbols { + key { [ B, A ] }; + modmap Mod1 { }; + }; +}; diff --git a/test_files/compile-tests/t03/t034/t0345/expected.xkb b/test_files/compile-tests/t03/t034/t0345/expected.xkb new file mode 100644 index 00000000..cded09f1 --- /dev/null +++ b/test_files/compile-tests/t03/t034/t0345/expected.xkb @@ -0,0 +1,39 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + modmap Mod1 { }; + + key.repeat = true; + + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ A ], + actions[Group1] = [ SetMods(modifiers = Mod1) ] + }; + }; +}; diff --git a/test_files/compile-tests/t03/t034/t0345/input.xkb b/test_files/compile-tests/t03/t034/t0345/input.xkb new file mode 100644 index 00000000..cd001b29 --- /dev/null +++ b/test_files/compile-tests/t03/t034/t0345/input.xkb @@ -0,0 +1,15 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret A + Mod1 { + xyz = true; + action = SetMods(mods = Mod1); + }; + }; + xkb_symbols { + key { [ A ] }; + modmap Mod1 { }; + }; +}; diff --git a/test_files/compile-tests/t03/t034/t0348/expected.xkb b/test_files/compile-tests/t03/t034/t0348/expected.xkb new file mode 100644 index 00000000..961c8f2f --- /dev/null +++ b/test_files/compile-tests/t03/t034/t0348/expected.xkb @@ -0,0 +1,21 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t03/t034/t0348/input.xkb b/test_files/compile-tests/t03/t034/t0348/input.xkb new file mode 100644 index 00000000..dcfdb557 --- /dev/null +++ b/test_files/compile-tests/t03/t034/t0348/input.xkb @@ -0,0 +1,5 @@ +xkb_keymap { + xkb_symbols { + modmap Mod1 { }; + }; +}; diff --git a/test_files/compile-tests/t03/t034/t0349/expected.xkb b/test_files/compile-tests/t03/t034/t0349/expected.xkb new file mode 100644 index 00000000..08856bac --- /dev/null +++ b/test_files/compile-tests/t03/t034/t0349/expected.xkb @@ -0,0 +1,37 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + modmap Mod1 { }; + + key.repeat = true; + + key { + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ A ] + }; + }; +}; diff --git a/test_files/compile-tests/t03/t034/t0349/input.xkb b/test_files/compile-tests/t03/t034/t0349/input.xkb new file mode 100644 index 00000000..1269751f --- /dev/null +++ b/test_files/compile-tests/t03/t034/t0349/input.xkb @@ -0,0 +1,12 @@ +xkb_keymap { + xkb_keycodes { + = 1; + alias = ; + alias = ; + alias = ; + }; + xkb_symbols { + key { [ A ] }; + modmap Mod1 { }; + }; +}; diff --git a/test_files/compile-tests/t03/t035/t0359/expected.xkb b/test_files/compile-tests/t03/t035/t0359/expected.xkb new file mode 100644 index 00000000..97eff954 --- /dev/null +++ b/test_files/compile-tests/t03/t035/t0359/expected.xkb @@ -0,0 +1,46 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + = 2; + }; + + xkb_types { + virtual_modifiers NumLock; + + type "KEYPAD" { + modifiers = Shift; + level_name[Level1] = "Base"; + level_name[Level2] = "Number"; + map[None] = Level1; + }; + + type "X" { + modifiers = Shift; + map[Shift] = Level2; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + type[Group1] = "KEYPAD", + symbols[Group1] = [ KP_1, KP_Home ] + }; + key { + type[Group1] = "X", + symbols[Group1] = [ KP_1, KP_Home ] + }; + }; +}; diff --git a/test_files/compile-tests/t03/t035/t0359/input.xkb b/test_files/compile-tests/t03/t035/t0359/input.xkb new file mode 100644 index 00000000..15ef834f --- /dev/null +++ b/test_files/compile-tests/t03/t035/t0359/input.xkb @@ -0,0 +1,20 @@ +xkb_keymap { + xkb_keycodes { + = 1; + = 2; + }; + xkb_types { + virtual_modifiers NumLock; + + type "X" { + modifiers = Shift + NumLock; + map[NumLock] = Level2; + map[Shift] = Level2; + }; + }; + xkb_symbols { + key { [ KP_1, KP_Home ] }; + key.type = "X"; + key { [ KP_1, KP_Home ] }; + }; +}; diff --git a/test_files/compile-tests/t03/t036/t0361/expected.xkb b/test_files/compile-tests/t03/t036/t0361/expected.xkb new file mode 100644 index 00000000..36ab155a --- /dev/null +++ b/test_files/compile-tests/t03/t036/t0361/expected.xkb @@ -0,0 +1,39 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + modmap Shift { }; + + key.repeat = true; + + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ { Shift_L, Alt_L } ], + actions[Group1] = [ { SetMods(modifiers = Shift), SetMods(modifiers = Mod1) } ] + }; + }; +}; diff --git a/test_files/compile-tests/t03/t036/t0361/input.xkb b/test_files/compile-tests/t03/t036/t0361/input.xkb new file mode 100644 index 00000000..925dbff7 --- /dev/null +++ b/test_files/compile-tests/t03/t036/t0361/input.xkb @@ -0,0 +1,17 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret Any+AnyOf(all) { + action = SetMods(mods = modmapmods); + }; + interpret Alt_L { + action = SetMods(mods = Mod1); + }; + }; + xkb_symbols { + key { [ { Shift_L, Alt_L } ] }; + modmap Shift { }; + }; +}; diff --git a/test_files/compile-tests/t03/t036/t0367/expected.xkb b/test_files/compile-tests/t03/t036/t0367/expected.xkb new file mode 100644 index 00000000..0c069507 --- /dev/null +++ b/test_files/compile-tests/t03/t036/t0367/expected.xkb @@ -0,0 +1,82 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + = 2; + = 3; + = 4; + = 5; + }; + + xkb_types { + virtual_modifiers V = Mod2; + virtual_modifiers W = 0x80000000; + + type "A" { + modifiers = Shift+Mod2; + map[Shift] = Level1; + preserve[Shift] = Shift; + map[Mod2] = Level2; + }; + + type "B" { + modifiers = Shift+Mod2; + map[Mod2] = Level2; + preserve[Mod2] = Mod2; + }; + + type "C" { + modifiers = Shift+Mod2; + map[Mod2] = Level2; + preserve[Mod2] = Mod2; + }; + + type "D" { + modifiers = Shift+Mod2; + map[Mod2] = Level2; + preserve[Mod2] = Mod2; + }; + + type "E" { + modifiers = Shift+Mod2; + map[0x80000000] = Level1; + preserve[0x80000000] = 0x80000000; + map[Mod2] = Level2; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + type[Group1] = "A", + symbols[Group1] = [ a ] + }; + key { + type[Group1] = "B", + symbols[Group1] = [ a ] + }; + key { + type[Group1] = "C", + symbols[Group1] = [ a ] + }; + key { + type[Group1] = "D", + symbols[Group1] = [ a ] + }; + key { + type[Group1] = "E", + symbols[Group1] = [ a ] + }; + }; +}; diff --git a/test_files/compile-tests/t03/t036/t0367/input.xkb b/test_files/compile-tests/t03/t036/t0367/input.xkb new file mode 100644 index 00000000..010979af --- /dev/null +++ b/test_files/compile-tests/t03/t036/t0367/input.xkb @@ -0,0 +1,47 @@ +xkb_Keymap { + xkb_keycodes { + = 1; + = 2; + = 3; + = 4; + = 5; + }; + xkb_types { + virtual_modifiers V = Mod2; + virtual_modifiers W = 0x80000000; + + type "A" { + modifiers = Shift + Mod2; + map[Mod2] = Level2; + preserve[Shift] = Shift; + }; + type "B" { + modifiers = Shift + Mod2 + V; + map[Mod2] = Level2; + preserve[V] = V; + }; + type "C" { + modifiers = Shift + Mod2 + V; + preserve[V] = V; + map[Mod2] = Level2; + }; + type "D" { + modifiers = Shift + Mod2 + V; + map[V] = Level3; + preserve[V] = V; + map[Mod2] = Level2; + }; + type "E" { + modifiers = Shift + Mod2 + V; + preserve[W] = W; + map[Mod2] = Level2; + }; + }; + xkb_symbols { + key { type = "A", [ a ] }; + key { type = "B", [ a ] }; + key { type = "C", [ a ] }; + key { type = "D", [ a ] }; + key { type = "E", [ a ] }; + }; +}; diff --git a/test_files/compile-tests/t03/t037/t0370/expected.xkb b/test_files/compile-tests/t03/t037/t0370/expected.xkb new file mode 100644 index 00000000..58043eff --- /dev/null +++ b/test_files/compile-tests/t03/t037/t0370/expected.xkb @@ -0,0 +1,40 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + = 2; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ a ] + }; + key { + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ b ] + }; + }; +}; diff --git a/test_files/compile-tests/t03/t037/t0370/input.xkb b/test_files/compile-tests/t03/t037/t0370/input.xkb new file mode 100644 index 00000000..a22563cc --- /dev/null +++ b/test_files/compile-tests/t03/t037/t0370/input.xkb @@ -0,0 +1,10 @@ +xkb_keymap { + xkb_keycodes { + = 1; + = 2; + }; + xkb_symbols { + include "a.xkb(v)" + include "a.xkb" + }; +}; diff --git a/test_files/compile-tests/t03/t037/t0370/symbols/a.xkb b/test_files/compile-tests/t03/t037/t0370/symbols/a.xkb new file mode 100644 index 00000000..cbb0b812 --- /dev/null +++ b/test_files/compile-tests/t03/t037/t0370/symbols/a.xkb @@ -0,0 +1,12 @@ +default xkb_symbols { + key { [ a ] }; +}; + +default xkb_symbols { + key { [ A ] }; +}; + +xkb_symbols "v" { + key { [ b ] }; +}; + diff --git a/test_files/compile-tests/t03/t038/t0384/expected.xkb b/test_files/compile-tests/t03/t038/t0384/expected.xkb new file mode 100644 index 00000000..ed45af5d --- /dev/null +++ b/test_files/compile-tests/t03/t038/t0384/expected.xkb @@ -0,0 +1,35 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ a ] + }; + }; +}; diff --git a/test_files/compile-tests/t03/t038/t0384/input.xkb b/test_files/compile-tests/t03/t038/t0384/input.xkb new file mode 100644 index 00000000..a508cbc8 --- /dev/null +++ b/test_files/compile-tests/t03/t038/t0384/input.xkb @@ -0,0 +1,11 @@ +xkb_keymap { + xkb_keycodes { + = 1; + alias = ; + alias = ; + }; + xkb_symbols { + key { [ a ] }; + key { [ a ] }; + }; +}; diff --git a/test_files/compile-tests/t03/t038/t0385/expected.xkb b/test_files/compile-tests/t03/t038/t0385/expected.xkb new file mode 100644 index 00000000..2b3b1b73 --- /dev/null +++ b/test_files/compile-tests/t03/t038/t0385/expected.xkb @@ -0,0 +1,45 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + = 2; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + modmap Mod1 { }; + + key.repeat = true; + + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ a ] + }; + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ a ], + actions[Group1] = [ SetMods(modifiers = Mod1) ] + }; + }; +}; diff --git a/test_files/compile-tests/t03/t038/t0385/input.xkb b/test_files/compile-tests/t03/t038/t0385/input.xkb new file mode 100644 index 00000000..c2becaa1 --- /dev/null +++ b/test_files/compile-tests/t03/t038/t0385/input.xkb @@ -0,0 +1,18 @@ +xkb_keymap { + xkb_keycodes { + = 1; + = 2; + }; + xkb_compat { + interpret a { + action = SetMods(mods = modmapmods); + }; + }; + xkb_symbols { + key { [ a ] }; + key { [ a ] }; + + modmap Mod1 { , }; + modmap None { }; + }; +}; diff --git a/test_files/compile-tests/t03/t039/t0390/expected.xkb b/test_files/compile-tests/t03/t039/t0390/expected.xkb new file mode 100644 index 00000000..1f0f2104 --- /dev/null +++ b/test_files/compile-tests/t03/t039/t0390/expected.xkb @@ -0,0 +1,38 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "TWO_LEVEL" { + modifiers = Shift; + level_name[Level1] = "Base"; + level_name[Level2] = "Shift"; + map[Shift] = Level2; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + repeat = false, + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ a, b ], + actions[Group1] = [ SetMods(modifiers = Mod1), SetMods(modifiers = Mod2) ] + }; + }; +}; diff --git a/test_files/compile-tests/t03/t039/t0390/input.xkb b/test_files/compile-tests/t03/t039/t0390/input.xkb new file mode 100644 index 00000000..6eda7ddb --- /dev/null +++ b/test_files/compile-tests/t03/t039/t0390/input.xkb @@ -0,0 +1,22 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret a { + action = SetMods(mods = Mod1); + }; + augment interpret a { + action = SetMods(mods = Mod2); + }; + interpret b { + action = SetMods(mods = Mod1); + }; + interpret b { + action = SetMods(mods = Mod2); + }; + }; + xkb_symbols { + key { [ a, b ] }; + }; +}; diff --git a/test_files/compile-tests/t03/t039/t0391/expected.xkb b/test_files/compile-tests/t03/t039/t0391/expected.xkb new file mode 100644 index 00000000..58be8dcd --- /dev/null +++ b/test_files/compile-tests/t03/t039/t0391/expected.xkb @@ -0,0 +1,29 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + virtual indicator 1 = "A"; + virtual indicator 2 = "B"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + indicator "A" { + modifiers = Mod1; + }; + indicator "B" { + modifiers = Mod2; + }; + + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t03/t039/t0391/input.xkb b/test_files/compile-tests/t03/t039/t0391/input.xkb new file mode 100644 index 00000000..608f0394 --- /dev/null +++ b/test_files/compile-tests/t03/t039/t0391/input.xkb @@ -0,0 +1,16 @@ +xkb_keymap { + xkb_compat { + indicator "A" { + mods = Mod1; + }; + augment indicator "A" { + mods = Mod2; + }; + indicator "B" { + mods = Mod1; + }; + indicator "B" { + mods = Mod2; + }; + }; +}; diff --git a/test_files/compile-tests/t03/t039/t0392/expected.xkb b/test_files/compile-tests/t03/t039/t0392/expected.xkb new file mode 100644 index 00000000..ed45af5d --- /dev/null +++ b/test_files/compile-tests/t03/t039/t0392/expected.xkb @@ -0,0 +1,35 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ a ] + }; + }; +}; diff --git a/test_files/compile-tests/t03/t039/t0392/input.xkb b/test_files/compile-tests/t03/t039/t0392/input.xkb new file mode 100644 index 00000000..f542b996 --- /dev/null +++ b/test_files/compile-tests/t03/t039/t0392/input.xkb @@ -0,0 +1,13 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret unknown { + action = SetMods(mods = Mod1); + }; + }; + xkb_symbols { + key { [ a, unknown ] }; + }; +}; diff --git a/test_files/compile-tests/t03/t039/t0394/expected.xkb b/test_files/compile-tests/t03/t039/t0394/expected.xkb new file mode 100644 index 00000000..ed45af5d --- /dev/null +++ b/test_files/compile-tests/t03/t039/t0394/expected.xkb @@ -0,0 +1,35 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ a ] + }; + }; +}; diff --git a/test_files/compile-tests/t03/t039/t0394/input.xkb b/test_files/compile-tests/t03/t039/t0394/input.xkb new file mode 100644 index 00000000..a5b6811e --- /dev/null +++ b/test_files/compile-tests/t03/t039/t0394/input.xkb @@ -0,0 +1,8 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_symbols { + include "a.xkb:1" + }; +}; diff --git a/test_files/compile-tests/t03/t039/t0394/symbols/a.xkb b/test_files/compile-tests/t03/t039/t0394/symbols/a.xkb new file mode 100644 index 00000000..f640e10c --- /dev/null +++ b/test_files/compile-tests/t03/t039/t0394/symbols/a.xkb @@ -0,0 +1,3 @@ +default xkb_symbols { + key { [ a ] }; +}; diff --git a/test_files/compile-tests/t04/t041/t0411/expected.xkb b/test_files/compile-tests/t04/t041/t0411/expected.xkb new file mode 100644 index 00000000..a96b8ced --- /dev/null +++ b/test_files/compile-tests/t04/t041/t0411/expected.xkb @@ -0,0 +1,37 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + = 2; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + actions[Group1] = [ RedirectKey(key = ) ] + }; + }; +}; diff --git a/test_files/compile-tests/t04/t041/t0411/input.xkb b/test_files/compile-tests/t04/t041/t0411/input.xkb new file mode 100644 index 00000000..55930f40 --- /dev/null +++ b/test_files/compile-tests/t04/t041/t0411/input.xkb @@ -0,0 +1,9 @@ +xkb_keymap { + xkb_keycodes { + = 1; + = 2; + }; + xkb_symbols { + key { [ RedirectKey(key = ) ] }; + }; +}; diff --git a/test_files/compile-tests/t04/t041/t0412/expected.xkb b/test_files/compile-tests/t04/t041/t0412/expected.xkb new file mode 100644 index 00000000..81cf7991 --- /dev/null +++ b/test_files/compile-tests/t04/t041/t0412/expected.xkb @@ -0,0 +1,37 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + = 2; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + actions[Group1] = [ RedirectKey(key = , clearMods = Mod1, mods = Shift) ] + }; + }; +}; diff --git a/test_files/compile-tests/t04/t041/t0412/input.xkb b/test_files/compile-tests/t04/t041/t0412/input.xkb new file mode 100644 index 00000000..02244144 --- /dev/null +++ b/test_files/compile-tests/t04/t041/t0412/input.xkb @@ -0,0 +1,9 @@ +xkb_keymap { + xkb_keycodes { + = 1; + = 2; + }; + xkb_symbols { + key { [ RedirectKey(key = , clearMods = Mod1, mods = Shift) ] }; + }; +}; diff --git a/test_files/compile-tests/t04/t041/t0413/expected.xkb b/test_files/compile-tests/t04/t041/t0413/expected.xkb new file mode 100644 index 00000000..75d72d7a --- /dev/null +++ b/test_files/compile-tests/t04/t041/t0413/expected.xkb @@ -0,0 +1,38 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + = 2; + }; + + xkb_types { + virtual_modifiers A = 0x00001000; + virtual_modifiers B = 0x00002000; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + actions[Group1] = [ RedirectKey(key = , clearMods = 0x00001000, mods = 0x00002000) ] + }; + }; +}; diff --git a/test_files/compile-tests/t04/t041/t0413/input.xkb b/test_files/compile-tests/t04/t041/t0413/input.xkb new file mode 100644 index 00000000..f7ef290c --- /dev/null +++ b/test_files/compile-tests/t04/t041/t0413/input.xkb @@ -0,0 +1,12 @@ +xkb_keymap { + xkb_keycodes { + = 1; + = 2; + }; + xkb_symbols { + virtual_modifiers A = 0x1000; + virtual_modifiers B = 0x2000; + + key { [ RedirectKey(key = , clearMods = A, mods = B) ] }; + }; +}; diff --git a/test_files/compile-tests/t04/t041/t0414/expected.xkb b/test_files/compile-tests/t04/t041/t0414/expected.xkb new file mode 100644 index 00000000..ba0de3be --- /dev/null +++ b/test_files/compile-tests/t04/t041/t0414/expected.xkb @@ -0,0 +1,28 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + repeat = false + }; + }; +}; diff --git a/test_files/compile-tests/t04/t041/t0414/input.xkb b/test_files/compile-tests/t04/t041/t0414/input.xkb new file mode 100644 index 00000000..b019b217 --- /dev/null +++ b/test_files/compile-tests/t04/t041/t0414/input.xkb @@ -0,0 +1,9 @@ +xkb_keymap { + xkb_keycodes { + = 1; + = 2; + }; + xkb_symbols { + key { [ RedirectKey(key = ) ] }; + }; +}; diff --git a/test_files/compile-tests/t04/t041/t0415/expected.xkb b/test_files/compile-tests/t04/t041/t0415/expected.xkb new file mode 100644 index 00000000..a96b8ced --- /dev/null +++ b/test_files/compile-tests/t04/t041/t0415/expected.xkb @@ -0,0 +1,37 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + = 2; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + actions[Group1] = [ RedirectKey(key = ) ] + }; + }; +}; diff --git a/test_files/compile-tests/t04/t041/t0415/input.xkb b/test_files/compile-tests/t04/t041/t0415/input.xkb new file mode 100644 index 00000000..1ea91899 --- /dev/null +++ b/test_files/compile-tests/t04/t041/t0415/input.xkb @@ -0,0 +1,10 @@ +xkb_keymap { + xkb_keycodes { + = 1; + = 2; + alias = ; + }; + xkb_symbols { + key { [ RedirectKey(key = ) ] }; + }; +}; diff --git a/test_files/compile-tests/t04/t041/t0416/expected.xkb b/test_files/compile-tests/t04/t041/t0416/expected.xkb new file mode 100644 index 00000000..a96b8ced --- /dev/null +++ b/test_files/compile-tests/t04/t041/t0416/expected.xkb @@ -0,0 +1,37 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + = 2; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + actions[Group1] = [ RedirectKey(key = ) ] + }; + }; +}; diff --git a/test_files/compile-tests/t04/t041/t0416/input.xkb b/test_files/compile-tests/t04/t041/t0416/input.xkb new file mode 100644 index 00000000..0748c2e4 --- /dev/null +++ b/test_files/compile-tests/t04/t041/t0416/input.xkb @@ -0,0 +1,12 @@ +xkb_keymap { + xkb_keycodes { + = 1; + = 2; + alias = ; + alias = ; + alias = ; + }; + xkb_symbols { + key { [ RedirectKey(key = ) ] }; + }; +}; diff --git a/test_files/compile-tests/t04/t042/t0421/expected.xkb b/test_files/compile-tests/t04/t042/t0421/expected.xkb new file mode 100644 index 00000000..4386378f --- /dev/null +++ b/test_files/compile-tests/t04/t042/t0421/expected.xkb @@ -0,0 +1,36 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + locks = true, + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ a ] + }; + }; +}; diff --git a/test_files/compile-tests/t04/t042/t0421/input.xkb b/test_files/compile-tests/t04/t042/t0421/input.xkb new file mode 100644 index 00000000..995c87c6 --- /dev/null +++ b/test_files/compile-tests/t04/t042/t0421/input.xkb @@ -0,0 +1,8 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_symbols { + key { locks, [ a ] }; + }; +}; diff --git a/test_files/compile-tests/t04/t042/t0422/expected.xkb b/test_files/compile-tests/t04/t042/t0422/expected.xkb new file mode 100644 index 00000000..ed45af5d --- /dev/null +++ b/test_files/compile-tests/t04/t042/t0422/expected.xkb @@ -0,0 +1,35 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ a ] + }; + }; +}; diff --git a/test_files/compile-tests/t04/t042/t0422/input.xkb b/test_files/compile-tests/t04/t042/t0422/input.xkb new file mode 100644 index 00000000..4b040198 --- /dev/null +++ b/test_files/compile-tests/t04/t042/t0422/input.xkb @@ -0,0 +1,8 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_symbols { + key { !locks, [ a ] }; + }; +}; diff --git a/test_files/compile-tests/t04/t042/t0423/expected.xkb b/test_files/compile-tests/t04/t042/t0423/expected.xkb new file mode 100644 index 00000000..ed45af5d --- /dev/null +++ b/test_files/compile-tests/t04/t042/t0423/expected.xkb @@ -0,0 +1,35 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ a ] + }; + }; +}; diff --git a/test_files/compile-tests/t04/t042/t0423/input.xkb b/test_files/compile-tests/t04/t042/t0423/input.xkb new file mode 100644 index 00000000..12c983b8 --- /dev/null +++ b/test_files/compile-tests/t04/t042/t0423/input.xkb @@ -0,0 +1,8 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_symbols { + key { locks, !locks, [ a ] }; + }; +}; diff --git a/test_files/compile-tests/t04/t042/t0424/expected.xkb b/test_files/compile-tests/t04/t042/t0424/expected.xkb new file mode 100644 index 00000000..4386378f --- /dev/null +++ b/test_files/compile-tests/t04/t042/t0424/expected.xkb @@ -0,0 +1,36 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + locks = true, + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ a ] + }; + }; +}; diff --git a/test_files/compile-tests/t04/t042/t0424/input.xkb b/test_files/compile-tests/t04/t042/t0424/input.xkb new file mode 100644 index 00000000..80705e83 --- /dev/null +++ b/test_files/compile-tests/t04/t042/t0424/input.xkb @@ -0,0 +1,8 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_symbols { + key { !locks, locks, [ a ] }; + }; +}; diff --git a/test_files/compile-tests/t04/t042/t0425/expected.xkb b/test_files/compile-tests/t04/t042/t0425/expected.xkb new file mode 100644 index 00000000..96a450a8 --- /dev/null +++ b/test_files/compile-tests/t04/t042/t0425/expected.xkb @@ -0,0 +1,29 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + repeat = false, + locks = true + }; + }; +}; diff --git a/test_files/compile-tests/t04/t042/t0425/input.xkb b/test_files/compile-tests/t04/t042/t0425/input.xkb new file mode 100644 index 00000000..587f237c --- /dev/null +++ b/test_files/compile-tests/t04/t042/t0425/input.xkb @@ -0,0 +1,9 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_symbols { + key { }; + augment key { locks }; + }; +}; diff --git a/test_files/compile-tests/t04/t043/t0430/expected.xkb b/test_files/compile-tests/t04/t043/t0430/expected.xkb new file mode 100644 index 00000000..4d71268a --- /dev/null +++ b/test_files/compile-tests/t04/t043/t0430/expected.xkb @@ -0,0 +1,37 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + repeat = false, + locks = true, + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ a ] + }; + }; +}; diff --git a/test_files/compile-tests/t04/t043/t0430/input.xkb b/test_files/compile-tests/t04/t043/t0430/input.xkb new file mode 100644 index 00000000..395e6726 --- /dev/null +++ b/test_files/compile-tests/t04/t043/t0430/input.xkb @@ -0,0 +1,13 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret a { + locking; + }; + }; + xkb_symbols { + key { [ a ] }; + }; +}; diff --git a/test_files/compile-tests/t04/t043/t0431/expected.xkb b/test_files/compile-tests/t04/t043/t0431/expected.xkb new file mode 100644 index 00000000..421593e4 --- /dev/null +++ b/test_files/compile-tests/t04/t043/t0431/expected.xkb @@ -0,0 +1,36 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "TWO_LEVEL" { + modifiers = Shift; + level_name[Level1] = "Base"; + level_name[Level2] = "Shift"; + map[Shift] = Level2; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ b, a ] + }; + }; +}; diff --git a/test_files/compile-tests/t04/t043/t0431/input.xkb b/test_files/compile-tests/t04/t043/t0431/input.xkb new file mode 100644 index 00000000..0ea2c663 --- /dev/null +++ b/test_files/compile-tests/t04/t043/t0431/input.xkb @@ -0,0 +1,13 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret a { + locking; + }; + }; + xkb_symbols { + key { [ b, a ] }; + }; +}; diff --git a/test_files/compile-tests/t04/t043/t0435/expected.xkb b/test_files/compile-tests/t04/t043/t0435/expected.xkb new file mode 100644 index 00000000..eca2fd3c --- /dev/null +++ b/test_files/compile-tests/t04/t043/t0435/expected.xkb @@ -0,0 +1,36 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ a ] + }; + }; +}; diff --git a/test_files/compile-tests/t04/t043/t0435/input.xkb b/test_files/compile-tests/t04/t043/t0435/input.xkb new file mode 100644 index 00000000..a58ad5ab --- /dev/null +++ b/test_files/compile-tests/t04/t043/t0435/input.xkb @@ -0,0 +1,13 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret a { + locking; + }; + }; + xkb_symbols { + key { !locks, [ a ] }; + }; +}; diff --git a/test_files/compile-tests/t04/t043/t0437/expected.xkb b/test_files/compile-tests/t04/t043/t0437/expected.xkb new file mode 100644 index 00000000..4d71268a --- /dev/null +++ b/test_files/compile-tests/t04/t043/t0437/expected.xkb @@ -0,0 +1,37 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + repeat = false, + locks = true, + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ a ] + }; + }; +}; diff --git a/test_files/compile-tests/t04/t043/t0437/input.xkb b/test_files/compile-tests/t04/t043/t0437/input.xkb new file mode 100644 index 00000000..6a42de6e --- /dev/null +++ b/test_files/compile-tests/t04/t043/t0437/input.xkb @@ -0,0 +1,13 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_compat { + interpret a { + locking = false; + }; + }; + xkb_symbols { + key { locks, [ a ] }; + }; +}; diff --git a/test_files/compile-tests/t04/t043/t0438/expected.xkb b/test_files/compile-tests/t04/t043/t0438/expected.xkb new file mode 100644 index 00000000..ed45af5d --- /dev/null +++ b/test_files/compile-tests/t04/t043/t0438/expected.xkb @@ -0,0 +1,35 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ a ] + }; + }; +}; diff --git a/test_files/compile-tests/t04/t043/t0438/input.xkb b/test_files/compile-tests/t04/t043/t0438/input.xkb new file mode 100644 index 00000000..0db5e617 --- /dev/null +++ b/test_files/compile-tests/t04/t043/t0438/input.xkb @@ -0,0 +1,8 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_symbols { + key { locks[1] = true, [ a ] }; + }; +}; diff --git a/test_files/compile-tests/t04/t043/t0439/expected.xkb b/test_files/compile-tests/t04/t043/t0439/expected.xkb new file mode 100644 index 00000000..331d63a8 --- /dev/null +++ b/test_files/compile-tests/t04/t043/t0439/expected.xkb @@ -0,0 +1,66 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + <1> = 1; + <2> = 2; + <3> = 3; + <4> = 4; + <5> = 5; + <6> = 6; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key <1> { + repeat = false, + type[Group1] = "ONE_LEVEL", + actions[Group1] = [ SetControls(controls = Overlay1) ] + }; + key <2> { + repeat = false, + type[Group1] = "ONE_LEVEL", + actions[Group1] = [ LockControls(controls = Overlay1+Overlay2) ] + }; + key <3> { + repeat = false, + type[Group1] = "ONE_LEVEL", + actions[Group1] = [ LockControls(controls = Overlay2, affect=lock) ] + }; + key <4> { + repeat = false, + type[Group1] = "ONE_LEVEL", + actions[Group1] = [ LockControls(controls = Overlay2, affect=unlock) ] + }; + key <5> { + repeat = false, + type[Group1] = "ONE_LEVEL", + actions[Group1] = [ LockControls(controls = Overlay2, affect=neither) ] + }; + key <6> { + repeat = false, + type[Group1] = "ONE_LEVEL", + actions[Group1] = [ LockControls(controls = Overlay2) ] + }; + }; +}; diff --git a/test_files/compile-tests/t04/t043/t0439/input.xkb b/test_files/compile-tests/t04/t043/t0439/input.xkb new file mode 100644 index 00000000..a91671df --- /dev/null +++ b/test_files/compile-tests/t04/t043/t0439/input.xkb @@ -0,0 +1,18 @@ +xkb_keymap { + xkb_keycodes { + <1> = 1; + <2> = 2; + <3> = 3; + <4> = 4; + <5> = 5; + <6> = 6; + }; + xkb_symbols { + key <1> { [ SetControls(controls = Overlay1) ] }; + key <2> { [ LockControls(controls = Overlay1+Overlay2) ] }; + key <3> { [ LockControls(controls = Overlay2, affect = lock) ] }; + key <4> { [ LockControls(controls = Overlay2, affect = unlock) ] }; + key <5> { [ LockControls(controls = Overlay2, affect = neither) ] }; + key <6> { [ LockControls(controls = Overlay2, affect = both) ] }; + }; +}; diff --git a/test_files/compile-tests/t04/t044/t0440/expected.xkb b/test_files/compile-tests/t04/t044/t0440/expected.xkb new file mode 100644 index 00000000..d5222200 --- /dev/null +++ b/test_files/compile-tests/t04/t044/t0440/expected.xkb @@ -0,0 +1,42 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + <1> = 1; + <2> = 2; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key <1> { + repeat = false, + type[Group1] = "ONE_LEVEL", + actions[Group1] = [ SetControls(controls = Overlay1) ] + }; + key <2> { + repeat = false, + type[Group1] = "ONE_LEVEL", + actions[Group1] = [ LockControls(controls = Overlay2) ] + }; + }; +}; diff --git a/test_files/compile-tests/t04/t044/t0440/input.xkb b/test_files/compile-tests/t04/t044/t0440/input.xkb new file mode 100644 index 00000000..7600137d --- /dev/null +++ b/test_files/compile-tests/t04/t044/t0440/input.xkb @@ -0,0 +1,12 @@ +xkb_keymap { + xkb_keycodes { + <1> = 1; + <2> = 2; + }; + xkb_symbols { + SetControls.controls = Overlay1; + LockControls.controls = Overlay2; + key <1> { [ SetControls() ] }; + key <2> { [ LockControls() ] }; + }; +}; diff --git a/test_files/compile-tests/t04/t044/t0443/expected.xkb b/test_files/compile-tests/t04/t044/t0443/expected.xkb new file mode 100644 index 00000000..d825118a --- /dev/null +++ b/test_files/compile-tests/t04/t044/t0443/expected.xkb @@ -0,0 +1,45 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + <1> = 1; + <2> = 2; + <3> = 3; + <4> = 4; + <5> = 5; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key <1> { + repeat = false, + overlay1 = <2> + }; + key <3> { + repeat = false, + locks = true + }; + key <4> { + repeat = false, + locks = true + }; + key <5> { + repeat = false, + overlay1 = <2> + }; + }; +}; diff --git a/test_files/compile-tests/t04/t044/t0443/input.xkb b/test_files/compile-tests/t04/t044/t0443/input.xkb new file mode 100644 index 00000000..65c76d39 --- /dev/null +++ b/test_files/compile-tests/t04/t044/t0443/input.xkb @@ -0,0 +1,20 @@ +xkb_keymap { + xkb_keycodes { + <1> = 1; + <2> = 2; + <3> = 3; + <4> = 4; + <5> = 5; + <6> = 6; + }; + xkb_symbols { + key <1> { overlay1 = <2> }; + augment key <1> { lock }; + key <3> { lock }; + augment key <3> { overlay1 = <2> }; + key <4> { overlay1 = <2> }; + override key <4> { lock }; + key <5> { lock }; + override key <5> { overlay1 = <2> }; + }; +}; diff --git a/test_files/compile-tests/t04/t044/t0445/expected.xkb b/test_files/compile-tests/t04/t044/t0445/expected.xkb new file mode 100644 index 00000000..1bfa07a7 --- /dev/null +++ b/test_files/compile-tests/t04/t044/t0445/expected.xkb @@ -0,0 +1,47 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + <1> = 1; + <2> = 2; + <3> = 3; + <4> = 4; + <5> = 5; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key <1> { + repeat = false + }; + key <2> { + repeat = false, + radiogroup = 1 + }; + key <3> { + repeat = false, + radiogroup = 3 + }; + key <4> { + repeat = false, + radiogroup = 5 + }; + key <5> { + repeat = false + }; + }; +}; diff --git a/test_files/compile-tests/t04/t044/t0445/input.xkb b/test_files/compile-tests/t04/t044/t0445/input.xkb new file mode 100644 index 00000000..87d795a0 --- /dev/null +++ b/test_files/compile-tests/t04/t044/t0445/input.xkb @@ -0,0 +1,16 @@ +xkb_keymap { + xkb_keycodes { + <1> = 1; + <2> = 2; + <3> = 3; + <4> = 4; + <5> = 5; + }; + xkb_symbols { + key <1> { radiogroup = 33 }; + key <2> { radiogroup = rg1 }; + key <3> { radiogroup = group3 }; + key <4> { radiogroup = radiogroup5 }; + key <5> { radiogroup = 0 }; + }; +}; diff --git a/test_files/compile-tests/t04/t044/t0449/expected.xkb b/test_files/compile-tests/t04/t044/t0449/expected.xkb new file mode 100644 index 00000000..a41b5b95 --- /dev/null +++ b/test_files/compile-tests/t04/t044/t0449/expected.xkb @@ -0,0 +1,38 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + <1> = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + modmap Mod1 { <1> }; + modmap Mod2 { x }; // <1> + + key.repeat = true; + + key <1> { + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ x ] + }; + }; +}; diff --git a/test_files/compile-tests/t04/t044/t0449/input.xkb b/test_files/compile-tests/t04/t044/t0449/input.xkb new file mode 100644 index 00000000..d63767d5 --- /dev/null +++ b/test_files/compile-tests/t04/t044/t0449/input.xkb @@ -0,0 +1,10 @@ +xkb_keymap { + xkb_keycodes { + <1> = 1; + }; + xkb_symbols { + key <1> { [ x ] }; + modmap Mod1 { <1> }; + modmap Mod2 { x }; + }; +}; diff --git a/test_files/compile-tests/t04/t045/t0450/expected.xkb b/test_files/compile-tests/t04/t045/t0450/expected.xkb new file mode 100644 index 00000000..a41b5b95 --- /dev/null +++ b/test_files/compile-tests/t04/t045/t0450/expected.xkb @@ -0,0 +1,38 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + <1> = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + modmap Mod1 { <1> }; + modmap Mod2 { x }; // <1> + + key.repeat = true; + + key <1> { + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ x ] + }; + }; +}; diff --git a/test_files/compile-tests/t04/t045/t0450/input.xkb b/test_files/compile-tests/t04/t045/t0450/input.xkb new file mode 100644 index 00000000..b047440b --- /dev/null +++ b/test_files/compile-tests/t04/t045/t0450/input.xkb @@ -0,0 +1,10 @@ +xkb_keymap { + xkb_keycodes { + <1> = 1; + }; + xkb_symbols { + key <1> { [ x ] }; + modmap Mod2 { x }; + modmap Mod1 { <1> }; + }; +}; diff --git a/test_files/compile-tests/t04/t045/t0451/expected.xkb b/test_files/compile-tests/t04/t045/t0451/expected.xkb new file mode 100644 index 00000000..83f8cbd2 --- /dev/null +++ b/test_files/compile-tests/t04/t045/t0451/expected.xkb @@ -0,0 +1,39 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + <1> = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "TWO_LEVEL" { + modifiers = Shift; + level_name[Level1] = "Base"; + level_name[Level2] = "Shift"; + map[Shift] = Level2; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + modmap Mod1 { y }; // <1> + modmap Mod2 { <1> }; + + key.repeat = true; + + key <1> { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ x, y ] + }; + }; +}; diff --git a/test_files/compile-tests/t04/t045/t0451/input.xkb b/test_files/compile-tests/t04/t045/t0451/input.xkb new file mode 100644 index 00000000..6b0e23d1 --- /dev/null +++ b/test_files/compile-tests/t04/t045/t0451/input.xkb @@ -0,0 +1,10 @@ +xkb_keymap { + xkb_keycodes { + <1> = 1; + }; + xkb_symbols { + key <1> { [ x, y ] }; + modmap Mod2 { x }; + modmap Mod1 { y }; + }; +}; diff --git a/test_files/compile-tests/t04/t045/t0452/expected.xkb b/test_files/compile-tests/t04/t045/t0452/expected.xkb new file mode 100644 index 00000000..0b648d1f --- /dev/null +++ b/test_files/compile-tests/t04/t045/t0452/expected.xkb @@ -0,0 +1,39 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + <1> = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "TWO_LEVEL" { + modifiers = Shift; + level_name[Level1] = "Base"; + level_name[Level2] = "Shift"; + map[Shift] = Level2; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + modmap Mod1 { <1> }; + modmap Mod2 { x }; // <1> + + key.repeat = true; + + key <1> { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ x, y ] + }; + }; +}; diff --git a/test_files/compile-tests/t04/t045/t0452/input.xkb b/test_files/compile-tests/t04/t045/t0452/input.xkb new file mode 100644 index 00000000..f5e429ef --- /dev/null +++ b/test_files/compile-tests/t04/t045/t0452/input.xkb @@ -0,0 +1,10 @@ +xkb_keymap { + xkb_keycodes { + <1> = 1; + }; + xkb_symbols { + key <1> { [ x, y ] }; + modmap Mod1 { y }; + modmap Mod2 { x }; + }; +}; diff --git a/test_files/compile-tests/t04/t046/t0460/expected.xkb b/test_files/compile-tests/t04/t046/t0460/expected.xkb new file mode 100644 index 00000000..902b28be --- /dev/null +++ b/test_files/compile-tests/t04/t046/t0460/expected.xkb @@ -0,0 +1,21 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + }; + + xkb_types { + virtual_modifiers a = Shift; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t04/t046/t0460/input.xkb b/test_files/compile-tests/t04/t046/t0460/input.xkb new file mode 100644 index 00000000..d95c8c51 --- /dev/null +++ b/test_files/compile-tests/t04/t046/t0460/input.xkb @@ -0,0 +1,6 @@ +xkb_keymap { + xkb_types { + virtual_modifiers a = 1; + virtual_modifiers a; + }; +}; diff --git a/test_files/compile-tests/t04/t046/t0461/expected.xkb b/test_files/compile-tests/t04/t046/t0461/expected.xkb new file mode 100644 index 00000000..cb7bbfa1 --- /dev/null +++ b/test_files/compile-tests/t04/t046/t0461/expected.xkb @@ -0,0 +1,21 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "B"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t04/t046/t0461/input.xkb b/test_files/compile-tests/t04/t046/t0461/input.xkb new file mode 100644 index 00000000..118b5302 --- /dev/null +++ b/test_files/compile-tests/t04/t046/t0461/input.xkb @@ -0,0 +1,7 @@ +xkb_keymap { + xkb_keycodes { + indicator 1 = "A"; + indicator 2 = "B"; + indicator 1 = "B"; + }; +}; diff --git a/test_files/compile-tests/t04/t046/t0462/expected.xkb b/test_files/compile-tests/t04/t046/t0462/expected.xkb new file mode 100644 index 00000000..8f266395 --- /dev/null +++ b/test_files/compile-tests/t04/t046/t0462/expected.xkb @@ -0,0 +1,22 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "B"; + indicator 3 = "C"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t04/t046/t0462/input.xkb b/test_files/compile-tests/t04/t046/t0462/input.xkb new file mode 100644 index 00000000..7840c10f --- /dev/null +++ b/test_files/compile-tests/t04/t046/t0462/input.xkb @@ -0,0 +1,11 @@ +xkb_keymap { + xkb_keycodes { + indicator 1 = "A"; + indicator 2 = "B"; + indicator 1 = "A"; + indicator 1 = "B"; + indicator 3 = "C"; + augment indicator 3 = "D"; + augment indicator 3 = "B"; + }; +}; diff --git a/test_files/compile-tests/t04/t048/t0482/expected.xkb b/test_files/compile-tests/t04/t048/t0482/expected.xkb new file mode 100644 index 00000000..b5f5272c --- /dev/null +++ b/test_files/compile-tests/t04/t048/t0482/expected.xkb @@ -0,0 +1,34 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "\001"; + indicator 2 = "語"; + indicator 3 = "日"; + indicator 4 = "\001\002\003"; + indicator 5 = "x\001\002\003y"; + indicator 6 = "ABC"; + indicator 7 = "A"; + indicator 8 = "B"; + indicator 9 = "C"; + indicator 10 = "D test"; + indicator 11 = "E"; + indicator 12 = "F"; + indicator 13 = "G"; + indicator 14 = "H"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t04/t048/t0482/input.xkb b/test_files/compile-tests/t04/t048/t0482/input.xkb new file mode 100644 index 00000000..e942284f --- /dev/null +++ b/test_files/compile-tests/t04/t048/t0482/input.xkb @@ -0,0 +1,18 @@ +xkb_keymap { + xkb_keycodes { + indicator 1 = "\u{1}"; + indicator 2 = "\u{8a9e}"; + indicator 3 = "\u{65E5}"; + indicator 4 = "\u{1}\u{2}\u{3}"; + indicator 5 = "x\u{1}\u{2}\u{3}y"; + indicator 6 = "\u{41}\u{42}\u{43}"; + indicator 7 = "A\u{41"; + indicator 8 = "B\u41}"; + indicator 9 = "C\u{41 hello world"; + indicator 10 = "D\u{41 hello world} test"; + indicator 11 = "E\u{AAAAAAAA}"; + indicator 12 = "F\u}"; + indicator 13 = "G\u"; + indicator 14 = "H\u{ 8a9e }"; + }; +}; diff --git a/test_files/compile-tests/t04/t048/t0483/expected.xkb b/test_files/compile-tests/t04/t048/t0483/expected.xkb new file mode 100644 index 00000000..fa60f084 --- /dev/null +++ b/test_files/compile-tests/t04/t048/t0483/expected.xkb @@ -0,0 +1,21 @@ +xkb_keymap "a\042b" { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t04/t048/t0483/input.xkb b/test_files/compile-tests/t04/t048/t0483/input.xkb new file mode 100644 index 00000000..a8aaafa9 --- /dev/null +++ b/test_files/compile-tests/t04/t048/t0483/input.xkb @@ -0,0 +1 @@ +xkb_keymap "a\u{22}b" { }; diff --git a/test_files/compile-tests/t04/t048/t0484/expected.xkb b/test_files/compile-tests/t04/t048/t0484/expected.xkb new file mode 100644 index 00000000..fa60f084 --- /dev/null +++ b/test_files/compile-tests/t04/t048/t0484/expected.xkb @@ -0,0 +1,21 @@ +xkb_keymap "a\042b" { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + }; + + xkb_types { + virtual_modifiers Dummy; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + }; +}; diff --git a/test_files/compile-tests/t04/t048/t0484/input.xkb b/test_files/compile-tests/t04/t048/t0484/input.xkb new file mode 100644 index 00000000..ffcd58a9 --- /dev/null +++ b/test_files/compile-tests/t04/t048/t0484/input.xkb @@ -0,0 +1 @@ +xkb_keymap "a\"b" { }; diff --git a/test_files/compile-tests/t04/t048/t0485/expected.xkb b/test_files/compile-tests/t04/t048/t0485/expected.xkb new file mode 100644 index 00000000..387f1214 --- /dev/null +++ b/test_files/compile-tests/t04/t048/t0485/expected.xkb @@ -0,0 +1,185 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + <01> = 1; + <02> = 2; + <03> = 3; + <04> = 4; + <05> = 5; + <06> = 6; + <07> = 7; + <08> = 8; + <09> = 9; + <10> = 10; + <11> = 11; + <12> = 12; + <13> = 13; + <14> = 14; + <15> = 15; + <16> = 16; + <17> = 17; + <18> = 18; + <19> = 19; + <20> = 20; + <21> = 21; + <22> = 22; + <23> = 23; + <24> = 24; + <25> = 25; + <26> = 26; + <27> = 27; + <28> = 28; + <29> = 29; + <30> = 30; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "TWO_LEVEL" { + modifiers = Shift; + level_name[Level1] = "Base"; + level_name[Level2] = "Shift"; + map[Shift] = Level2; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key <01> { + repeat = false, + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ NoSymbol, 0x01000000 ] + }; + key <02> { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ U1, U1 ] + }; + key <03> { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ Linefeed, 0x0100000a ] + }; + key <04> { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ U1f, U1f ] + }; + key <05> { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ space, 0x01000020 ] + }; + key <06> { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ asciitilde, 0x0100007e ] + }; + key <07> { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ Delete, 0x0100007f ] + }; + key <08> { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ U80, U80 ] + }; + key <09> { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ U9f, U9f ] + }; + key <10> { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ nobreakspace, 0x010000a0 ] + }; + key <11> { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ ydiaeresis, 0x010000ff ] + }; + key <12> { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ U100, U100 ] + }; + key <13> { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ Ud7ff, Ud7ff ] + }; + key <14> { + repeat = false, + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ NoSymbol, Ud800 ] + }; + key <15> { + repeat = false, + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ NoSymbol, Udfff ] + }; + key <16> { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ Ue000, Ue000 ] + }; + key <17> { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ Ufdcf, Ufdcf ] + }; + key <18> { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ Ufdd0, Ufdd0 ] + }; + key <19> { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ Ufdef, Ufdef ] + }; + key <20> { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ Ufdf0, Ufdf0 ] + }; + key <21> { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ Ufffd, Ufffd ] + }; + key <22> { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ Ufffe, Ufffe ] + }; + key <23> { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ Uffff, Uffff ] + }; + key <24> { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ U10000, U10000 ] + }; + key <25> { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ U1fffe, U1fffe ] + }; + key <26> { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ U1ffff, U1ffff ] + }; + key <27> { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ U10fffe, U10fffe ] + }; + key <28> { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ U10ffff, U10ffff ] + }; + key <29> { + repeat = false, + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ NoSymbol, 0x01110000 ] + }; + key <30> { + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ Wcircumflex, Wcircumflex ] + }; + }; +}; diff --git a/test_files/compile-tests/t04/t048/t0485/input.xkb b/test_files/compile-tests/t04/t048/t0485/input.xkb new file mode 100644 index 00000000..12c29492 --- /dev/null +++ b/test_files/compile-tests/t04/t048/t0485/input.xkb @@ -0,0 +1,66 @@ +xkb_keymap { + xkb_keycodes { + <01> = 01; + <02> = 02; + <03> = 03; + <04> = 04; + <05> = 05; + <06> = 06; + <07> = 07; + <08> = 08; + <09> = 09; + <10> = 10; + <11> = 11; + <12> = 12; + <13> = 13; + <14> = 14; + <15> = 15; + <16> = 16; + <17> = 17; + <18> = 18; + <19> = 19; + <20> = 20; + <21> = 21; + <22> = 22; + <23> = 23; + <24> = 24; + <25> = 25; + <26> = 26; + <27> = 27; + <28> = 28; + <29> = 29; + <30> = 30; + }; + xkb_symbols { + key <01> { [ NoSymbol, 0x01000000 ] }; + key <02> { [ 0x01000001, 0x01000001 ] }; + key <03> { [ Linefeed, 0x0100000a ] }; + key <04> { [ 0x0100001f, 0x0100001f ] }; + key <05> { [ space, 0x01000020 ] }; + key <06> { [ asciitilde, 0x0100007e ] }; + key <07> { [ Delete, 0x0100007f ] }; + key <08> { [ 0x01000080, 0x01000080 ] }; + key <09> { [ 0x0100009f, 0x0100009f ] }; + key <10> { [ nobreakspace, 0x010000a0 ] }; + key <11> { [ ydiaeresis, 0x010000ff ] }; + key <12> { [ U0100, U0100 ] }; + key <13> { [ UD7FF, UD7FF ] }; + key <14> { [ NoSymbol, 0x0100d800 ] }; + key <15> { [ NoSymbol, 0x0100dfff ] }; + key <16> { [ UE000, UE000 ] }; + key <17> { [ UFDCF, UFDCF ] }; + key <18> { [ UFDD0, UFDD0 ] }; + key <19> { [ UFDEF, UFDEF ] }; + key <20> { [ UFDF0, UFDF0 ] }; + key <21> { [ UFFFD, UFFFD ] }; + key <22> { [ UFFFE, UFFFE ] }; + key <23> { [ UFFFF, UFFFF ] }; + key <24> { [ U10000, U10000 ] }; + key <25> { [ U1FFFE, U1FFFE ] }; + key <26> { [ U1FFFF, U1FFFF ] }; + key <27> { [ U10FFFE, U10FFFE ] }; + key <28> { [ U10FFFF, U10FFFF ] }; + key <29> { [ NoSymbol, 0x01110000 ] }; + key <30> { [ Wcircumflex, Wcircumflex ] }; + }; +}; diff --git a/test_files/compile-tests/t04/t048/t0486/expected.xkb b/test_files/compile-tests/t04/t048/t0486/expected.xkb new file mode 100644 index 00000000..fa89abf7 --- /dev/null +++ b/test_files/compile-tests/t04/t048/t0486/expected.xkb @@ -0,0 +1,72 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + = 2; + = 3; + = 4; + = 5; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + + type "TWO_LEVEL" { + modifiers = Shift; + level_name[Level1] = "Base"; + level_name[Level2] = "Shift"; + map[Shift] = Level2; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ x ], + actions[Group1] = [ { SetMods(modifiers = Mod1), SetMods(modifiers = Mod2) } ] + }; + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ { x, y } ], + actions[Group1] = [ { SetMods(modifiers = Mod1), SetMods(modifiers = Mod2), SetGroup(group = Group1), LatchGroup(group = Group2) } ] + }; + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ y ], + actions[Group1] = [ { SetGroup(group = Group1), LatchGroup(group = Group2) } ] + }; + key { + repeat = false, + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ x, y ], + actions[Group1] = [ { SetMods(modifiers = Mod1), SetMods(modifiers = Mod2) }, { SetGroup(group = Group1), LatchGroup(group = Group2) } ] + }; + key { + repeat = false, + type[Group1] = "TWO_LEVEL", + symbols[Group1] = [ x, { y, x } ], + actions[Group1] = [ { SetMods(modifiers = Mod1), SetMods(modifiers = Mod2) }, { SetGroup(group = Group1), LatchGroup(group = Group2), SetMods(modifiers = Mod1), SetMods(modifiers = Mod2) } ] + }; + }; +}; diff --git a/test_files/compile-tests/t04/t048/t0486/input.xkb b/test_files/compile-tests/t04/t048/t0486/input.xkb new file mode 100644 index 00000000..bb8b901f --- /dev/null +++ b/test_files/compile-tests/t04/t048/t0486/input.xkb @@ -0,0 +1,24 @@ +xkb_keymap { + xkb_keycodes { + = 1; + = 2; + = 3; + = 4; + = 5; + }; + xkb_compat { + interpret x { + action = { SetMods(mods = Mod1), SetMods(mods = Mod2) }; + }; + interpret y { + action = { SetGroup(group = 1), LatchGroup(group = 2) }; + }; + }; + xkb_symbols { + key { [ x ] }; + key { [ { x, y } ] }; + key { [ y ] }; + key { [ x, y ] }; + key { [ x, { y, x } ] }; + }; +}; diff --git a/test_files/compile-tests/t04/t049/t0492/expected.xkb b/test_files/compile-tests/t04/t049/t0492/expected.xkb new file mode 100644 index 00000000..dae64e80 --- /dev/null +++ b/test_files/compile-tests/t04/t049/t0492/expected.xkb @@ -0,0 +1,34 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers X; + + type "ONE_LEVEL" { + modifiers = Mod1; + map[Mod1] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ a ] + }; + }; +}; diff --git a/test_files/compile-tests/t04/t049/t0492/input.xkb b/test_files/compile-tests/t04/t049/t0492/input.xkb new file mode 100644 index 00000000..235cfea5 --- /dev/null +++ b/test_files/compile-tests/t04/t049/t0492/input.xkb @@ -0,0 +1,16 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_types { + virtual_modifiers X; + type "ONE_LEVEL" { + modifiers = Mod1 + X; + map[Mod1] = Level1; + map[Mod1 + X] = Level2; + }; + }; + xkb_symbols { + key { [ a ] }; + }; +}; diff --git a/test_files/compile-tests/t04/t049/t0493/expected.xkb b/test_files/compile-tests/t04/t049/t0493/expected.xkb new file mode 100644 index 00000000..1c24d0bd --- /dev/null +++ b/test_files/compile-tests/t04/t049/t0493/expected.xkb @@ -0,0 +1,36 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + key.repeat = true; + + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + actions[Group1] = [ LockControls(controls = none, affect=neither) ] + }; + }; +}; diff --git a/test_files/compile-tests/t04/t049/t0493/input.xkb b/test_files/compile-tests/t04/t049/t0493/input.xkb new file mode 100644 index 00000000..ad374e6b --- /dev/null +++ b/test_files/compile-tests/t04/t049/t0493/input.xkb @@ -0,0 +1,8 @@ +xkb_keymap { + xkb_keycodes { + = 1; + }; + xkb_symbols { + key { [ VoidAction() ] }; + }; +}; diff --git a/test_files/compile-tests/t04/t049/t0494/expected.xkb b/test_files/compile-tests/t04/t049/t0494/expected.xkb new file mode 100644 index 00000000..c972b868 --- /dev/null +++ b/test_files/compile-tests/t04/t049/t0494/expected.xkb @@ -0,0 +1,49 @@ +xkb_keymap { + xkb_keycodes { + minimum = 8; + maximum = 255; + + indicator 1 = "DUMMY"; + + = 1; + = 2; + = 3; + }; + + xkb_types { + virtual_modifiers Dummy; + + type "ONE_LEVEL" { + modifiers = None; + level_name[Level1] = "Any"; + map[None] = Level1; + }; + }; + + xkb_compat { + interpret VoidSymbol { + repeat = false; + }; + }; + + xkb_symbols { + modmap Mod1 { }; + + key.repeat = true; + + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ a ] + }; + key { + repeat = false, + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ b ] + }; + key { + type[Group1] = "ONE_LEVEL", + symbols[Group1] = [ c ] + }; + }; +}; diff --git a/test_files/compile-tests/t04/t049/t0494/input.xkb b/test_files/compile-tests/t04/t049/t0494/input.xkb new file mode 100644 index 00000000..2edf3671 --- /dev/null +++ b/test_files/compile-tests/t04/t049/t0494/input.xkb @@ -0,0 +1,21 @@ +xkb_keymap { + xkb_keycodes { + = 1; + = 2; + = 3; + }; + xkb_compat { + interpret 0x61 { + repeat = false; + }; + interpret 0x62 + Mod1 { + repeat = false; + }; + }; + xkb_symbols { + key { [ a ] }; + key { [ b ] }; + key { [ c ] }; + modmap Mod1 { b }; + }; +}; diff --git a/test_files/type-include/keycodes/generated b/test_files/type-include/keycodes/generated new file mode 100644 index 00000000..571601eb --- /dev/null +++ b/test_files/type-include/keycodes/generated @@ -0,0 +1,518 @@ +default xkb_keycodes { + = 9; + <1> = 10; + <2> = 11; + <3> = 12; + <4> = 13; + <5> = 14; + <6> = 15; + <7> = 16; + <8> = 17; + <9> = 18; + <0> = 19; + = 20; + = 21; + = 22; + = 23; + = 24; + = 25; + = 26; + = 27; + = 28; + = 29; + = 30; + = 31; + = 32; +

= 33; + = 34; + = 35; + = 36; + = 37; + = 38; + = 39; + = 40; + = 41; + = 42; + = 43; + = 44; + = 45; + = 46; + = 47; + = 48; + = 49; + = 50; + = 51; + = 52; + = 53; + = 54; + = 55; + = 56; + = 57; + = 58; + = 59; + = 60; + = 61; + = 62; + = 63; + = 64; + = 65; + = 66; + = 67; + = 68; + = 69; + = 70; + = 71; + = 72; + = 73; + = 74; + = 75; + = 76; + = 77; + = 78; + = 79; + = 80; + = 81; + = 82; + = 83; + = 84; + = 85; + = 86; + = 87; + = 88; + = 89; + = 90; + = 91; + = 93; + <102nd> = 94; + = 95; + = 96; + = 97; + = 98; + = 99; + = 100; + = 101; + = 102; + = 103; + = 104; + = 105; + = 106; + = 107; + = 108; + = 109; + = 110; + = 111; + = 112; + = 113; + = 114; + = 115; + = 116; + = 117; + = 118; + = 119; + = 120; + = 121; + = 122; + = 123; + = 124; + = 125; + = 126; + = 127; + = 128; + = 129; + = 130; + alias = ; + = 131; + = 132; + = 133; + = 134; + = 135; + = 136; + = 137; + = 138; + = 139; + = 140; + = 141; + = 142; + = 143; + = 144; + = 145; + = 146; +

= 147; + = 148; + = 149; + = 150; + = 151; + = 152; + = 153; + = 154; + = 155; + = 156; + = 157; + = 158; + = 159; + = 160; + alias = ; + = 161; + alias = ; + = 162; + = 163; + = 164; + = 165; + = 166; + = 167; + = 168; + = 169; + = 170; + = 171; + = 172; + = 173; + = 174; + = 175; + = 176; + = 177; + = 178; + = 179; + = 180; + = 181; + = 182; + = 183; + = 184; + = 185; + = 186; + = 187; + = 188; + = 189; + = 190; + = 191; + = 192; + = 193; + = 194; + = 195; + = 196; + = 197; + = 198; + = 199; + = 200; + = 201; + = 202; + = 208; + = 209; + = 210; + = 211; + = 212; + alias = ; + = 213; + = 214; + = 215; + = 216; + = 217; + = 218; + = 219; + = 220; + = 221; + = 222; + = 223; + = 224; + = 225; + = 226; + = 227; + = 228; + = 229; + = 230; + = 231; + = 232; + = 233; + = 234; + = 235; + = 236; + = 237; + = 238; + = 239; + = 240; + = 241; + = 242; + = 243; + = 244; + = 245; + = 246; + = 247; + = 248; + = 249; + = 250; + = 251; + = 252; + alias = ; + = 253; + = 254; + alias = ; + = 255; + = 256; + = 360; +