DrmKit.Avalonia 0.1.5

dotnet add package DrmKit.Avalonia --version 0.1.5
                    
NuGet\Install-Package DrmKit.Avalonia -Version 0.1.5
                    
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="DrmKit.Avalonia" Version="0.1.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DrmKit.Avalonia" Version="0.1.5" />
                    
Directory.Packages.props
<PackageReference Include="DrmKit.Avalonia" />
                    
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 DrmKit.Avalonia --version 0.1.5
                    
#r "nuget: DrmKit.Avalonia, 0.1.5"
                    
#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 DrmKit.Avalonia@0.1.5
                    
#: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=DrmKit.Avalonia&version=0.1.5
                    
Install as a Cake Addin
#tool nuget:?package=DrmKit.Avalonia&version=0.1.5
                    
Install as a Cake Tool

DrmKit.Avalonia

Helpers for running Avalonia apps directly on Linux DRM/Framebuffer (kiosk / embedded, no X11 / Wayland).

  • evdev keyboard: EN/RU, Alt+Shift, CapsLock, text input into focused control;
  • on‑screen keyboard overlay (KeyboardOverlay) for touch UI;
  • soft cursor overlay with auto‑hide and proper pointer over events;
  • evdev mouse fallback for DRM when there is no windowing system;
  • SmartPlatform — runtime switch: DRM ↔ desktop with CLI options.

Main namespace: Avalonia.DrmKit
Recommended: Avalonia 11, .NET 8, Linux with /dev/dri/card* and /dev/input/event*.


Install

dotnet add package DrmKit.Avalonia

Quick start

Program.cs:

using Avalonia;
using Avalonia.DrmKit;

internal static class Program
{
    public static int Main(string[] args)
        => SmartPlatform.Start(BuildAvaloniaApp(), args);

    public static AppBuilder BuildAvaloniaApp()
        => AppBuilder.Configure<App>()
            .UsePlatformDetect()
            .LogToTrace()
            .UseReactiveUI()
            .UseDrmSoftCursor()         // soft cursor overlay for DRM
            .UseLinuxKeyboardListener() // evdev keyboard (EN/RU, Alt+Shift, CapsLock)
            .UseEvdevMouseFallback();   // evdev mouse + pointerover fix for DRM
}

Run in DRM mode:

# user should be in 'video' and 'input' groups
./YourApp --system=drm --drm=card1 --resolution=1280x720

# debug evdev input
DRMKIT_DEBUG=1 ./YourApp --system=drm --drm=card1

If DRM cannot be initialized, SmartPlatform falls back to the standard Avalonia desktop backend.


On‑screen keyboard overlay

Attach overlay keyboard to any TextBox:

<TextBox
    xmlns:osk="clr-namespace:Avalonia.DrmKit.OnScreenKeyboard;assembly=Avalonia.DrmKit"
    osk:KeyboardOverlay.IsEnabled="True"
    Watermark="Tap to enter text" />

Behaviour:

  • when a TextBox with KeyboardOverlay.IsEnabled="True" receives focus, a shared on‑screen keyboard panel appears at the bottom of the main window;
  • when focus leaves all such TextBox controls, the keyboard hides;
  • physical keyboard state (EN/RU, CapsLock) is synchronized with the overlay.

Layouts:

  • EN and RU (йцукен);
  • switching: Alt+Shift on physical keyboard or button on the overlay;
  • CapsLock is synchronized both ways.

Soft cursor & auto‑hide

UseDrmSoftCursor() adds an overlay layer that renders a software cursor on top of the window.

Features:

  • always visible in DRM even without hardware cursor;
  • correct PointerEntered / PointerExited / PointerMoved for Avalonia controls;
  • auto‑hide after idle (default: 3 seconds) with smooth fade‑out;
  • theming for light/dark themes and full customization via styles/templates.

Example style in App.axaml:

<Application.Styles>
  <Style Selector="t|SoftCursorLayer">
    <Setter Property="AutoHideDelay" Value="0:0:3" /> 
    <Setter Property="StrokeBrush"   Value="White" />
    <Setter Property="FillBrush"     Value="#80FFFFFF" />
    <Setter Property="PressedFillBrush" Value="#C0FFFFFF" />
  </Style>
</Application.Styles>

To fully replace visuals (text, image, custom shape), set DisableDefaultRendering="True" and provide your own Template or Content.


SmartPlatform CLI (very short)

SmartPlatform understands several useful command‑line options:

--system=auto|drm|desktop
--drm=card0|card1|/dev/dri/card1|1
--resolution=1280x720

Typical DRM run:

./YourApp --system=drm --drm=card0 --resolution=1920x1080

If no DRM card is found (no /dev/dri/card*), the library automatically starts the regular Avalonia desktop backend instead.


Кратко по‑русски

  • Пакет для запуска Avalonia в чистом DRM/Framebuffer.
  • Даёт: экранную клавиатуру‑оверлей, evdev‑клавиатуру, мышь через evdev, софт‑курсор с авто‑скрытием и нормальными pointerover‑событиями.
  • Интеграция — один вызов SmartPlatform.Start(...) + три extension‑метода для AppBuilder.
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
0.1.5 413 11/19/2025
0.1.4 396 11/18/2025
0.1.3 338 11/17/2025
0.1.2 338 11/17/2025
0.1.1 322 11/17/2025
0.1.0 339 11/17/2025

Первый публичный релиз: DRM/FB ввод, экранная клавиатура, софт-курсор. Обновление иконки