Userland: Move HID input device nodes to /dev/input/{mouse,keyboard}

Because HID devices are not always present in quantities of one per type
it is more elegant and correct to put the representative device nodes in
subdirectories for each HID device type.
This commit is contained in:
Liav A 2022-09-10 12:25:20 +03:00 committed by Sam Atkins
commit 89835558b4
Notes: sideshowbarker 2024-07-17 07:18:07 +09:00
3 changed files with 13 additions and 10 deletions

View file

@ -20,8 +20,8 @@ namespace WindowServer {
EventLoop::EventLoop()
{
m_keyboard_fd = open("/dev/keyboard0", O_RDONLY | O_NONBLOCK | O_CLOEXEC);
m_mouse_fd = open("/dev/mouse0", O_RDONLY | O_NONBLOCK | O_CLOEXEC);
m_keyboard_fd = open("/dev/input/keyboard/0", O_RDONLY | O_NONBLOCK | O_CLOEXEC);
m_mouse_fd = open("/dev/input/mouse/0", O_RDONLY | O_NONBLOCK | O_CLOEXEC);
m_window_server = MUST(IPC::MultiServer<ConnectionFromClient>::try_create("/tmp/portal/window"));
m_wm_server = MUST(IPC::MultiServer<WMConnectionFromClient>::try_create("/tmp/portal/wm"));
@ -30,14 +30,14 @@ EventLoop::EventLoop()
m_keyboard_notifier = Core::Notifier::construct(m_keyboard_fd, Core::Notifier::Read);
m_keyboard_notifier->on_ready_to_read = [this] { drain_keyboard(); };
} else {
dbgln("Couldn't open /dev/keyboard0");
dbgln("Couldn't open /dev/input/keyboard/0");
}
if (m_mouse_fd >= 0) {
m_mouse_notifier = Core::Notifier::construct(m_mouse_fd, Core::Notifier::Read);
m_mouse_notifier->on_ready_to_read = [this] { drain_mouse(); };
} else {
dbgln("Couldn't open /dev/mouse0");
dbgln("Couldn't open /dev/input/mouse/0");
}
}