freedesktop.libxkbcommon
#includelibxkbcommon 1.13.2 — keymap compilation and keyboard state, xkbcomp parser pre-generated
#include <xkbcommon/xkbcommon.h>
mcpp add freedesktop.libxkbcommon@1.13.2
用法
來自本倉庫自己的測試專案 —— CI 真的編譯並執行過,不是為了網站寫的。
// libxkbcommon, exercised through the generated parser.
//
// The package is a fork for exactly one reason: `src/xkbcomp/parser.y` is
// bison's input and the 3,960-line parser is generated. So the test compiles a
// keymap FROM A STRING — that runs the parser end to end and needs no
// xkeyboard-config data on disk, which is what makes it runnable on a CI
// machine and in a sandbox.
//
// A package that linked but whose parser was generated without
// `-p _xkbcommon_`, or not regenerated after a version bump, fails here rather
// than in somebody's compositor.
#ifdef __linux__
#include <xkbcommon/xkbcommon.h>
#include <cstdio>
#include <cstring>
#include <cstdlib>
namespace {
// …
tests/examples/libxkbcommon/tests/libxkbcommon.cpp · 專案 tests/examples/libxkbcommon
建置 · 上游資訊清單
- targets
xkbcommon (lib)- language
c++23- manifest version
1.13.2- 來源
https://raw.githubusercontent.com/mcpplibs/libxkbcommon/1.13.2/mcpp/xkbcommon/mcpp.toml