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

Kernel/HID: Add methods to attach and detach standalone devices

This commit is contained in:
Liav A 2022-03-05 14:12:36 +02:00 committed by Jelle Raaijmakers
parent 83835c7256
commit 62c2c9df69
3 changed files with 27 additions and 0 deletions

View file

@ -115,6 +115,20 @@ void HIDManagement::set_maps(NonnullOwnPtr<KString> character_map_name, Keyboard
});
}
void HIDManagement::detach_standalone_hid_device(HIDDevice& device)
{
m_standalone_hid_devices.with([&](auto& list) {
list.remove(device);
});
}
void HIDManagement::attach_standalone_hid_device(HIDDevice& device)
{
m_standalone_hid_devices.with([&](auto& list) {
list.append(device);
});
}
UNMAP_AFTER_INIT ErrorOr<void> HIDManagement::enumerate()
{
// FIXME: When we have USB HID support, we should ensure that we disable