Products › lamco-dsi-tools › Interfaces › wlroots virtual keyboard and pointer

wlroots virtual keyboard and pointer: Input injection on Wayland

zwp_virtual_keyboard_manager_v1 and zwlr_virtual_pointer_manager_v1 let a client inject input on wlroots compositors: Who offers them, and how to check.

Wayland protocols zwp_virtual_keyboard_manager_v1, zwlr_virtual_pointer_manager_v1

The wlroots virtual keyboard and pointer are two Wayland protocols, zwp_virtual_keyboard_manager_v1 and zwlr_virtual_pointer_manager_v1, with which a client creates a keyboard and a pointer that the compositor treats as input devices of a seat. On compositors that offer them, such as Sway, they're how on-screen keyboards, automation tools and remote desktop servers send input without a portal. lamco-dsi-tools (DSI: Desktop session interfaces) reads whether the compositor advertises both managers, sends input through them with dsido wlr inject, and pairs each step with the event a window received.

What it is

The virtual keyboard protocol is virtual-keyboard-unstable-v1. A client calls create_virtual_keyboard on the manager with a seat and gets a zwp_virtual_keyboard_v1. Before any key it has to upload a keymap with the keymap request, as a file descriptor in XKB format; a key sent before that is a protocol error. Then key sends a key code with a time and a state, and modifiers sends the modifier state, which the compositor doesn't work out for a virtual keyboard by itself. The manager can answer unauthorized, which is how a compositor refuses a client it doesn't let type.

The virtual pointer protocol is wlr-virtual-pointer-unstable-v1, at version 2. create_virtual_pointer, or create_virtual_pointer_with_output to tie absolute positions to one output, gives a zwlr_virtual_pointer_v1 with motion, motion_absolute (a position inside an extent the client states), button, the axis requests for scrolling, and frame to group them.

Neither protocol has a permission dialog, and neither sends a touch. Because the client uploads the keymap, the keys produce what that keymap says, whatever layout the desktop itself is set to. That's the opposite of libei, where the keymap is the compositor's.

When input injection doesn't work on a wlroots compositor, the usual questions are whether both managers are advertised, whether the compositor refuses the client, and whether the window you're watching had the keyboard focus. A capture answers each one.

Which desktops offered it

DesktopState
GNOME Shell 48.7 (Debian 13)absent
GNOME Shell 51.0 (Fedora 45)absent
KDE Plasma, KWin 6.5.6 (NixOS)absent
KDE Plasma, KWin 6.8.2 (KDE neon)absent
Sway 1.9present
Hyprland 0.56.2present
COSMIC, cosmic-comp 1.0.0present
labwc 0.20.3 (Budgie session, CachyOS)present
Cinnamon Wayland session (Linux Mint)absent

Each cell is from one capture of one version of the desktop on one virtual machine, taken on 2026-11-27 or 2026-11-28 with dsisee observe. dsisee sends no input, so an input route is present at most in its captures: Offered, and not exercised. GNOME and KDE take input through libei and the RemoteDesktop portal instead.

The README's run record: On Sway 1.9, dsido wlr inject text with the witness and dsitell loop, 32 of 32 steps paired, and dsido wlr replay with loop and compare.

The project's record of runs, reconciled on 2026-12-04, adds:

  • Keyboard layouts on the wlroots route, dsido wlr inject with --layout and the witness, on Sway 1.9 on 2026-11-28: Text typed on the German, French, British and US layouts, every key paired by the witness. The session's own layout was unchanged.

The record, through 2026-11-29, has no run of --layout on any compositor but Sway 1.9.

How to check it with lamco-dsi-tools

dsisee input routes                       # every input route the desktop advertises, and what each has for touch
dsisee wayland protocols                  # every global, the two managers among them
dsisee observe --out capture.json         # everything that needs no dialog
dsitell health capture.json               # the input function and its routes

dsisee input routes reads the registry for the two managers, the portal, the uinput node and what of libei is installed, and prints the input part of the health summary. It sends nothing. In dsitell health the route is read from the registry, and it becomes working only in a capture dsido wlr inject wrote.

Driving it with dsido

dsisee input witness --duration 60 --out witness.json &    # a window that records what reaches it
dsido wlr inject text "hello" --out inject.json            # type through the virtual keyboard
dsido wlr inject click --at 960,540 --out click.json       # a click through the virtual pointer
dsitell loop inject.json witness.json                      # pair each step with its event
dsido wlr inject text "grüß" --layout de --out de.json     # upload a German keymap and type on it

Every route of dsido turns an action into the same steps, so a capture from this route can be sent again through libei or the kernel with dsido eis replay or dsido kernel replay. The capture holds each step with the time it was requested and sent, and a keymap record of the layout uploaded. A character the layout has no key for is left out and named, and a touch is refused before anything is opened.

Findings

  • INPUT-001: No input route was found.
  • INPUT-005: Input couldn't be injected through a route.
  • INPUT-006: An injection route refused the injector, as unauthorized does here.
  • INPUT-007: Some characters of an injected text have no key.
  • INPUT-011: An injector sent nothing, since no witness window had the keyboard focus.
  • INPUT-012: A touch was asked for where there's no touchscreen to send it through.

Related