xkbcommon-dotnet 1.13.6

dotnet add package xkbcommon-dotnet --version 1.13.6
                    
NuGet\Install-Package xkbcommon-dotnet -Version 1.13.6
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="xkbcommon-dotnet" Version="1.13.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="xkbcommon-dotnet" Version="1.13.6" />
                    
Directory.Packages.props
<PackageReference Include="xkbcommon-dotnet" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add xkbcommon-dotnet --version 1.13.6
                    
#r "nuget: xkbcommon-dotnet, 1.13.6"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package xkbcommon-dotnet@1.13.6
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=xkbcommon-dotnet&version=1.13.6
                    
Install as a Cake Addin
#tool nuget:?package=xkbcommon-dotnet&version=1.13.6
                    
Install as a Cake Tool

xkbcommon-dotnet

xkbcommon-dotnet are .NET bindings for libxkbcommon.

Usage

using Xkb;

using var context = XkbContext.Create();
using var keymap = context.CreateKeymap(new XkbRuleNames { Layout = "de", Options = "grp:alt_shift_toggle" });
using var state = keymap.CreateState();

// Feed evdev key events (keycode = evdev code + 8) and read the results.
state.UpdateKey(keycode, XkbKeyDirection.Down);
XkbKeysym sym = state.GetKeyOneSym(keycode);
Console.WriteLine($"{sym.Name} -> \"{state.GetKeyString(keycode)}\"");

Dead keys via compose:

using var compose = context.CreateComposeTable().CreateState();
compose.Feed(XkbKeysym.FromName("dead_acute"));
compose.Feed(XkbKeysym.FromName("a"));
if (compose.Status == XkbComposeStatus.Composed)
    Console.WriteLine(compose.GetUtf8()); // á

Enumerating available layouts with the registry:

using var registry = XkbRegistry.Create();
foreach (var layout in registry.Layouts)
    Console.WriteLine($"{layout.Name} {layout.Variant}: {layout.Description}");

X11 clients can build keymaps from the server with XkbX11. The xcb connection is passed as a raw pointer:

var info = XkbX11.SetupXkbExtension(xcbConnection);
int deviceId = XkbX11.GetCoreKeyboardDeviceId(xcbConnection);
using var keymap = XkbX11.CreateKeymap(context, xcbConnection, deviceId);
using var state = XkbX11.CreateState(keymap, xcbConnection, deviceId);

Testing

dotnet test

Regenerating the bindings

git submodule update --init
dotnet tool restore
sh eng/generate.sh

Requires a system clang for its builtin-header resource directory, and the libxcb headers for the X11 pass.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-ios26.0 is compatible.  net10.0-maccatalyst was computed.  net10.0-maccatalyst26.0 is compatible.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-tvos26.0 is compatible.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net10.0-ios26.0

    • No dependencies.
  • net10.0-maccatalyst26.0

    • No dependencies.
  • net10.0-tvos26.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.13.6 102 9/17/2026
1.13.5 214 8/13/2026
1.13.2 415 7/28/2026