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/.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/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..082df8ea --- /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; +use wkb::testing::ListComposerTestExt; + +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); + 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..b08d6ccb --- /dev/null +++ b/benches/bench_key.rs @@ -0,0 +1,365 @@ +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..8abb099f --- /dev/null +++ b/benches/bench_setup.rs @@ -0,0 +1,138 @@ +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/examples/bench_memory.rs b/examples/bench_memory.rs index 5bf78845..ea3c59d5 100644 --- a/examples/bench_memory.rs +++ b/examples/bench_memory.rs @@ -8,7 +8,7 @@ //! Or for quick RSS measurement: //! /usr/bin/time -v ./target/release/examples/bench_memory 2>&1 | grep "Maximum resident" -use wkb::testing::WKBTestExt; +use wkb::testing::{ListComposerTestExt, WKBTestExt}; #[path = "../benches/common.rs"] mod common; @@ -66,7 +66,6 @@ fn run_workload_wkb() -> u64 { if let Some(subpath) = xkb_core::compose::resolve_compose_file(COMPOSE_LOCALE) { let path = std::path::Path::new("/usr/share/X11/locale").join(&subpath); let mut composer = wkb::testing::compose_parse::load_compose_from_path(&path); - use wkb::testing::Composer; for seq in COMPOSE_SEQUENCES { for _ in 0..HOT_PATH_ITERATIONS { for &ks in seq.keysyms { diff --git a/examples/bench_size_wkb.rs b/examples/bench_size_wkb.rs index d3546ffd..49e1a0d9 100644 --- a/examples/bench_size_wkb.rs +++ b/examples/bench_size_wkb.rs @@ -7,7 +7,7 @@ mod common; use common::*; use std::hint::black_box; -use wkb::testing::WKBTestExt; +use wkb::testing::{ListComposerTestExt, WKBTestExt}; fn main() { let mut checksum: u64 = 0; @@ -36,7 +36,6 @@ fn main() { if let Some(subpath) = xkb_core::compose::resolve_compose_file(COMPOSE_LOCALE) { let path = std::path::Path::new("/usr/share/X11/locale").join(&subpath); let mut composer = wkb::testing::compose_parse::load_compose_from_path(&path); - use wkb::testing::Composer; for seq in COMPOSE_SEQUENCES { for &ks in seq.keysyms { if let Some(ch) = xkb_core::keysym_utf::keysym_to_char(ks) { diff --git a/examples/profile_setup.rs b/examples/profile_setup.rs new file mode 100644 index 00000000..0b0688f7 --- /dev/null +++ b/examples/profile_setup.rs @@ -0,0 +1,86 @@ +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/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/composer.rs b/src/composer.rs index b20ed6f2..0d8c6c76 100644 --- a/src/composer.rs +++ b/src/composer.rs @@ -5,14 +5,9 @@ pub enum Token { Compose, } -pub trait Composer: std::fmt::Debug { - fn feed(&mut self, token: Token) -> ComposeState; - fn reset(&mut self); -} - #[derive(Debug, Clone, PartialEq, Eq)] pub enum ComposeState { - Idle(Token), + Idle(char), Composing(String), Finished(char), Cancelled, @@ -37,19 +32,19 @@ pub(crate) struct TrieNode { } #[derive(Debug, Clone)] -pub struct ListComposer { +pub struct Composer { pub(crate) nodes: Vec, cur: u32, pending: Vec, } -impl Default for ListComposer { +impl Default for Composer { fn default() -> Self { Self::new() } } -impl ListComposer { +impl Composer { pub fn new() -> Self { Self { nodes: vec![TrieNode { @@ -118,11 +113,9 @@ impl ListComposer { s } -} -impl Composer for ListComposer { #[inline] - fn feed(&mut self, token: Token) -> ComposeState { + pub(crate) fn feed(&mut self, token: Token) -> ComposeState { let key = token_key(&token); let node = &self.nodes[self.cur as usize]; @@ -142,7 +135,10 @@ impl Composer for ListComposer { } Err(_) => { if self.cur == 0 { - ComposeState::Idle(token) + match token { + Token::Compose => ComposeState::Idle('·'), + Token::Char(c) => ComposeState::Idle(c), + } } else { self.cur = 0; self.pending.clear(); @@ -152,7 +148,7 @@ impl Composer for ListComposer { } } - fn reset(&mut self) { + pub(crate) fn reset(&mut self) { self.cur = 0; self.pending.clear(); } diff --git a/src/lib.rs b/src/lib.rs index a9a37f63..aadc4630 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -23,7 +23,10 @@ //! - **`compose`** (default) — Compose-key / dead-key sequence support. //! - **`testing`** — Exposes internal helpers for integration tests. Not part of the public API. -use composer::{ComposeState, Composer, ListComposer, Token}; +#[cfg(feature = "xkb")] +use std::cell::OnceCell; + +use composer::{ComposeState, Composer, Token}; mod composer; pub use modifiers::KeyDirection; use modifiers::ModType; @@ -140,24 +143,28 @@ 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 struct WKB { pub(crate) pressed_keys: KeyBitSet, pub(crate) repeat_keys: KeyBitSet, - pub(crate) composer: C, + pub(crate) composer: Composer, pub(crate) modifiers: Modifiers, 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, } #[cfg(feature = "xkb")] -impl WKB { +impl WKB { /// Create WKB instance from RMLVO names (Rules, Model, Layout, Variant, Options) pub fn new_from_names(locale: String, layout: Option) -> Self { xkb::new_from_names(locale, layout) @@ -169,7 +176,7 @@ impl WKB { } } -impl WKB { +impl WKB { /// Reset all transient input state: compose sequence and pressed keys. /// Call on wl_keyboard.leave or when focus changes. pub fn reset_state(&mut self) { @@ -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 { @@ -288,7 +300,7 @@ impl WKB { /// Resolve the character for the given evdev keycode under the current modifier state. #[inline] - pub fn utf8(&mut self, evdev_code: u32) -> Option { + fn utf8(&mut self, evdev_code: u32) -> Option { let (none_active, level2, level3, level5) = self.modifiers.active_none_and_levels(); if none_active { return None; @@ -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/testing.rs b/src/testing.rs index 1e4574b3..891db0ef 100644 --- a/src/testing.rs +++ b/src/testing.rs @@ -1,7 +1,7 @@ //! Test-only utilities for WKB integration tests. //! Not part of the public API — use `wkb::testing::*` in test files only. -pub use crate::composer::{ComposeState, Composer, ListComposer, Token}; +pub use crate::composer::{ComposeState, Composer, Token}; pub use crate::modifiers::{ModType, Modifiers}; use crate::xkb; pub use crate::WKB; @@ -22,9 +22,11 @@ pub trait WKBTestExt { fn level3_code(&self) -> Option<(u32, Option)>; fn level5_code(&self) -> Option<(u32, Option)>; fn update_key(&mut self, evdev_code: u32, key_direction: crate::KeyDirection) -> bool; + fn utf8(&mut self, evdev_code: u32) -> Option; + fn composer(&self) -> &Composer; } -impl WKBTestExt for WKB { +impl WKBTestExt for WKB { fn active_mod_type(&self, mod_type: ModType) -> bool { self.modifiers.active_mod_type(mod_type) } @@ -52,14 +54,22 @@ impl WKBTestExt for WKB { fn update_key(&mut self, evdev_code: u32, key_direction: crate::KeyDirection) -> bool { self.update_key(evdev_code, key_direction) } + + fn utf8(&mut self, evdev_code: u32) -> Option { + self.utf8(evdev_code) + } + + fn composer(&self) -> &Composer { + &self.composer + } } -pub trait ComposerTestExt { - fn composer(&self) -> &C; +pub trait ListComposerTestExt { + fn feed(&mut self, token: Token) -> ComposeState; } -impl ComposerTestExt for WKB { - fn composer(&self) -> &C { - &self.composer +impl ListComposerTestExt for Composer { + fn feed(&mut self, token: Token) -> ComposeState { + self.feed(token) } } diff --git a/src/xkb.rs b/src/xkb.rs index 30e05907..dc2116e4 100644 --- a/src/xkb.rs +++ b/src/xkb.rs @@ -5,12 +5,12 @@ // WKB integration functions use crate::composer::Token; use crate::modifiers::*; +use crate::Composer; use crate::FlatKeymap; -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() { @@ -120,8 +120,8 @@ fn press_level_modifiers( } /// Load compose entries from a file and build a ListComposer. -pub fn load_compose_from_path(path: &std::path::Path) -> ListComposer { - let mut regular = ListComposer::new(); +pub fn load_compose_from_path(path: &std::path::Path) -> Composer { + let mut regular = Composer::new(); let entries = xkb_core::compose::parse_compose_file(path); @@ -147,14 +147,19 @@ fn build_wkb_from_keymap( keymap: &xkb_core::rust_types::Keymap, locale: Option, layout: Option, - all_layouts: Vec, store_keymap: bool, -) -> WKB { +) -> WKB { const XKB_MAX_LEVELS: usize = 8; 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 { @@ -268,17 +273,17 @@ fn build_wkb_from_keymap( let path = std::path::Path::new("/usr/share/X11/locale").join(&subpath); load_compose_from_path(&path) }) - .unwrap_or_else(ListComposer::new); + .unwrap_or_else(Composer::new); #[cfg(not(feature = "compose"))] - let composer = ListComposer::new(); + let composer = Composer::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, @@ -296,15 +301,9 @@ fn build_wkb_from_keymap( } /// Create a new WKB instance from locale and layout names -pub fn new_from_names(locale: String, layout: Option) -> WKB { +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()); @@ -312,7 +311,7 @@ pub fn new_from_names(locale: String, layout: Option) -> WKB WKB { +pub fn new_from_string(string: String) -> WKB { use xkb_core::rust_types::Context; let ctx = Context::new().expect("Failed to create XKB context"); @@ -481,13 +480,15 @@ pub fn new_from_string(string: String) -> 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/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; +