diff --git a/local/recipes/system/udev-shim/source/src/scheme.rs b/local/recipes/system/udev-shim/source/src/scheme.rs index 7045841a..7d726711 100644 --- a/local/recipes/system/udev-shim/source/src/scheme.rs +++ b/local/recipes/system/udev-shim/source/src/scheme.rs @@ -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()) diff --git a/recipes/wip/libs/other/libinput/recipe.toml b/recipes/wip/libs/other/libinput/recipe.toml index 4792da87..7573453d 100644 --- a/recipes/wip/libs/other/libinput/recipe.toml +++ b/recipes/wip/libs/other/libinput/recipe.toml @@ -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", ]