Wire evdevd input devices into udev-shim and enable udev in libinput

Phase 3 input chain wiring:

udev-shim: when scheme:evdev is registered (by evdevd), probe for
event0..event7 devices and create /dev/input/eventN nodes pointing to
scheme:evdev/eventN. This bridges evdevd's evdev devices into the
/dev/input namespace that libinput and compositors expect.

libinput: remove -Dudev=false and add libudev-stub as a dependency.
The libudev-stub recipe provides libudev.so that reads from scheme:udev
(udev-shim), giving libinput a working udev enumeration path instead of
stub functions that return NULL.

Input chain is now: hardware → /scheme/input → evdevd → scheme:evdev →
udev-shim → /dev/input/eventN → libudev-stub → libinput → KWin.
This commit is contained in:
2026-04-25 13:15:12 +01:00
parent 843f30ba42
commit 38013bbf16
2 changed files with 38 additions and 2 deletions
@@ -126,6 +126,42 @@ impl UdevScheme {
));
}
// evdevd exposes event0(event1)(mouse), event2(touchpad) via scheme:evdev.
// Probe which exist and create /dev/input/eventN nodes for libinput.
if scheme_registered("evdev") {
for n in 0..8u8 {
let name = format!("event{n}");
if std::path::Path::new(&format!("/scheme/evdev/{name}")).exists() {
let (devpath, kind) = match n {
0 => (
"/devices/platform/evdev-keyboard0",
InputKind::Keyboard,
),
1 => (
"/devices/platform/evdev-mouse0",
InputKind::Mouse,
),
_ => (
&*format!("/devices/platform/evdev-generic{n}"),
InputKind::Generic,
),
};
let label = match kind {
InputKind::Keyboard => "Redox Evdev Keyboard",
InputKind::Mouse => "Redox Evdev Mouse",
_ => "Redox Evdev Generic",
};
self.devices.push(DeviceInfo::new_platform_input(
label,
devpath,
kind,
"",
"",
));
}
}
}
self.assign_virtual_nodes();
Ok(self.devices.len())
+2 -2
View File
@@ -1,4 +1,4 @@
#TODO: needs libevdev working; udev integration is disabled so the compositor owns device discovery
#TODO: needs libevdev working; udev integration via libudev-stub (scheme:udev)
[source]
tar = "https://gitlab.freedesktop.org/libinput/libinput/-/archive/1.30.2/libinput-1.30.2.tar.bz2"
patches = ["redox.patch"]
@@ -10,9 +10,9 @@ mesonflags = [
"-Dmtdev=false",
"-Ddebug-gui=false",
"-Dtests=false",
"-Dudev=false",
"-Ddocumentation=false",
]
dependencies = [
"libevdev",
"libudev-stub",
]