1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 21:48:13 +00:00

Kernel/HID: Introduce the all-mice device

This device will be used by userspace to read mouse packets from all
mouse devices that are attached to the machine.

This change is a preparation before we can enable seamless hotplug
capabilities in WindowServer for mouse devices, without any major change
on the userspace side.
This commit is contained in:
Liav A 2023-10-06 21:59:39 +03:00 committed by Andrew Kaster
parent 75183402fd
commit 8a0a3638f0
6 changed files with 111 additions and 0 deletions

View file

@ -79,6 +79,11 @@ static constexpr Keyboard::CharacterMapData DEFAULT_CHARACTER_MAP =
};
// clang-format on
void HIDManagement::enqueue_mouse_packet(Badge<MouseDevice>, MousePacket packet)
{
m_all_mice_device->enqueue_mouse_packet(packet);
}
void HIDManagement::set_client(KeyboardClient* client)
{
SpinlockLocker locker(m_client_lock);
@ -103,6 +108,7 @@ UNMAP_AFTER_INIT HIDManagement::KeymapData::KeymapData()
}
UNMAP_AFTER_INIT HIDManagement::HIDManagement()
: m_all_mice_device(AllMiceDevice::must_create())
{
}