Skip to content

Introduce base InputDevice class

Vlad Zahorodnii requested to merge work/zzag/input-device-refactor into master

The main motivation behind this change is to prepare input abstractions for virtual input devices so the wl_seat can properly advertise caps or the cursor getting properly mapped/unmapped when a fake pointer is added/removed on a system without a hardware mouse connected.

With this, there are three abstractions - InputDevice, InputBackend, and InputRedirection.

An InputDevice represents an input device such as a mouse, a keyboard, a tablet, etc. The InputBackend class notifies the InputRedirection about (dis-)connected devices. The InputRedirection manages the input devices.

Such design allows to unify the event flow for real and virtual input devices.

There can be several input backends active. For example, the libinput backend and an input backend that provides virtual input devices, e.g. libeis or org_kde_kwin_fake_input.


  • Add Platform::createInputBackend() or something like that?
  • Make windowed platform plugins create dummy input devices
    • X11 backend
    • Wayland backend: need to figure out how to clean up the wayland backend
      Done. Code's still a bit 💩 though, no idea how to make it nicer.
  • Port the drm backend away from SeatInterface::hasPointer()
  • Port fake input devices to InputDevice

fixes #43 (closed)

Edited by Vlad Zahorodnii

Merge request reports