41 lines
975 B
C
41 lines
975 B
C
|
|
#pragma once
|
|||
|
|
|
|||
|
|
#include "MID/Mid_Def.h"
|
|||
|
|
|
|||
|
|
/*
|
|||
|
|
* 这份文件负责解析 report id 0x01 的 NKRO 包。
|
|||
|
|
*
|
|||
|
|
* 这里解析的是“Windows 最终可见的键盘态”:
|
|||
|
|
* - 会受下位机遮罩影响
|
|||
|
|
* - 不是 0x04 那种物理镜像流
|
|||
|
|
*
|
|||
|
|
* 当前下位机结构固定为:
|
|||
|
|
* [report_id(1) | modifier(1) | usage_bitmap(29)]
|
|||
|
|
* 总长度 31 字节
|
|||
|
|
*/
|
|||
|
|
struct Lgc_Nkro_Struct_Result
|
|||
|
|
{
|
|||
|
|
// 首字节是否匹配 0x01。
|
|||
|
|
bool IsMatch = false;
|
|||
|
|
|
|||
|
|
// 长度是否符合 31 字节。
|
|||
|
|
bool IsLengthOk = false;
|
|||
|
|
|
|||
|
|
// 第 1 字节修饰键位图。
|
|||
|
|
quint8 Modifier = 0;
|
|||
|
|
|
|||
|
|
// 第 2~30 字节 usage 位图原文。
|
|||
|
|
QByteArray UsageBitmap;
|
|||
|
|
|
|||
|
|
// 展开后的 HID usage 列表。
|
|||
|
|
QVector<quint16> UsageList;
|
|||
|
|
|
|||
|
|
// 展开后的按键名称列表。
|
|||
|
|
QStringList UsageTextList;
|
|||
|
|
|
|||
|
|
// 给调试窗口用的简短中文说明。
|
|||
|
|
QString TextExplain;
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
void Lgc_Nkro_Func_Parse(const QByteArray& ByteArray, Lgc_Nkro_Struct_Result* p_Result);
|