1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 22:57:34 +00:00

Kernel/HID: Introduce initial USB mouse support

This commit is contained in:
Liav A 2023-05-05 09:05:04 +03:00 committed by Jelle Raaijmakers
parent 430e987078
commit 77441079dd
6 changed files with 266 additions and 0 deletions

View file

@ -0,0 +1,44 @@
/*
* Copyright (c) 2023, Liav A. <liavalb@hotmail.co.il>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/StdLibExtraDetails.h>
#include <AK/StringView.h>
#include <AK/Types.h>
namespace Kernel::USB::HID {
enum class SubclassCode : u8 {
BootProtocol = 0x01,
};
struct [[gnu::packed]] MouseBootProtocolPacket {
u8 buttons;
i8 x;
i8 y;
i8 z;
i8 reserved1;
i8 reserved2;
};
static_assert(AssertSize<MouseBootProtocolPacket, 6>());
constexpr StringView subclass_string(SubclassCode code)
{
switch (code) {
case SubclassCode::BootProtocol:
return "Boot Protocol"sv;
}
return "Reserved"sv;
}
enum class InterfaceProtocol : u8 {
Mouse = 0x02,
};
}