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:
parent
430e987078
commit
77441079dd
6 changed files with 266 additions and 0 deletions
44
Kernel/Bus/USB/Drivers/HID/Codes.h
Normal file
44
Kernel/Bus/USB/Drivers/HID/Codes.h
Normal 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,
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue