Recursive AI
LibraryC#Available

oneplatform

Windows, input, IME, clipboard, DPI, displays, gamepads and the desktop shell for .NET applications on Windows, macOS, Linux (Wayland and X11), Android, iOS and the browser.

Open source, MIT or Apache-2.0, made by Recursive AI. Version 1.0.0 is on NuGet, for .NET 10. It depends only on the .NET base class library, and is NativeAOT- and trim-compatible.

dotnet add package RecursiveAI.OnePlatform --version 1.0.0

A quick look

A test with no display: the headless backend’s windows are in-memory objects, and the injector sends them the input a user would.

Getting started also opens a real window, and has both programs in full with their output.

Getting started
Program.csOnePlatform 1.0.0 · .NET 10
using OnePlatform;
 
using var app = PlatformApp.Create(
    new PlatformOptions { Backend = PlatformBackendKind.Headless });
var window = app.CreateWindow(new WindowOptions { Width = 640, Height = 480 });
 
app.Injector.Text(window.Id, "héllo");
app.Injector.KeyPress(window.Id, Key.Enter);
app.Injector.CloseRequest(window.Id);
 
app.PumpEvents();
while (app.TryGetEvent(out var e))
    Console.WriteLine(e.Kind switch
    {
        PlatformEventKind.TextInput => $"typed {e.Text}",
        PlatformEventKind.KeyDown => $"key {e.Key}",
        _ => e.Kind.ToString(),
    });
OutputLinux, headless backend
typed héllo
key Enter
KeyUp
WindowCloseRequested
What it does

What it does

One app object

One PlatformApp per process owns the windows, the event queue and the input state. Each operating system’s own API is used directly: Win32, the Objective-C runtime for Cocoa and UIKit, Xlib and the Wayland client protocol on Linux, the NDK on Android, and a small script in the browser.

Desktop windows

Decorated, movable and resizable by default, and can be dialogs, always-on-top overlays or popups.

Desktop services

A D-Bus client and the Linux portals, the Windows and macOS equivalents (tray icon, notifications, file dialogs, global hotkeys, menu bar, screenshots, single-instance hand-over), and a window accessibility provider that is bridged to UI Automation on Windows and NSAccessibility on macOS.

Tests without a display

A headless backend and InputInjector drive an app with no display, so tests can click, type and resize without a window.

Controllers and input

Game controllers, haptics, input actions with rebinding, and text clipboard access are included.

Platforms

WindowsmacOSLinuxAndroid, iOSBrowser
WindowsWin32: ordinary windows, dialogs, overlays, popups, size limits, fullscreenCocoa: ordinary windows, dialogs, overlays, popups, size limits, fullscreenWayland (xdg-decoration, wlr-layer-shell, xdg_popup) and X11 (EWMH)one window per activity or sceneone canvas
Inputkeyboard, mouse, touch, gamepads (XInput)keyboard, mouse, trackpad, gamepadskeyboard, mouse, touch, gamepads (evdev)touch, keyboard, gamepadskeyboard, mouse, touch, Gamepad API
IMEWM_IME_*NSTextInputClienttext-input-v3 on Wayland; composed keys on X11system soft keyboardpage text input
Clipboard (UTF-8 text)yesyesyes (X11 primary selection too)yesyes
DPI and displaysper-monitor v2backing scalewp_fractional_scale, wp_viewporter, X11 scalesystem scaledevicePixelRatio
Shell servicesWindowsDesktop: tray icon, notifications, file dialogs, global hotkeys, menu bar, screenshots; LocalSingleInstanceMacDesktop: menu bar, status item, file panels, notifications, hotkeys; LocalSingleInstanceportals and notification, tray and single-instance services over D-Busnonenone
D-Bus and portalsn/an/aDBusConnection, FileChooserPortal, ScreenshotPortal, GlobalShortcutsSession, NotificationService, TrayIcon, SingleInstancen/an/a
AccessibilityUI Automation providerNSAccessibility providerprovider model onlyprovider model onlyprovider model only
Injection and captureInputInjector; window and region captureInputInjectorInputInjector; screenshot portalInputInjectorInputInjector

“Provider model only” means Window.Accessibility keeps the provider and nothing reads it on that system (WindowAccessibility.IsSupported is false). The headless backend works everywhere and has no operating-system window.

Go further