mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 22:28:11 +00:00
Kernel: Expose minor device numbers for keyboard and mouse
A fix for two FIXMEs, and paving the way for multi-keyboard/mouse support, I guess.
This commit is contained in:
parent
6536a979d8
commit
370231c05c
4 changed files with 8 additions and 12 deletions
|
@ -30,8 +30,8 @@ EventLoop::EventLoop()
|
|||
: m_window_server(Core::LocalServer::construct())
|
||||
, m_wm_server(Core::LocalServer::construct())
|
||||
{
|
||||
m_keyboard_fd = open("/dev/keyboard", O_RDONLY | O_NONBLOCK | O_CLOEXEC);
|
||||
m_mouse_fd = open("/dev/mouse", O_RDONLY | O_NONBLOCK | O_CLOEXEC);
|
||||
m_keyboard_fd = open("/dev/keyboard0", O_RDONLY | O_NONBLOCK | O_CLOEXEC);
|
||||
m_mouse_fd = open("/dev/mouse0", O_RDONLY | O_NONBLOCK | O_CLOEXEC);
|
||||
|
||||
bool ok = m_window_server->take_over_from_system_server("/tmp/portal/window");
|
||||
VERIFY(ok);
|
||||
|
@ -64,14 +64,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/keyboard");
|
||||
dbgln("Couldn't open /dev/keyboard0");
|
||||
}
|
||||
|
||||
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/mouse");
|
||||
dbgln("Couldn't open /dev/mouse0");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue