添加项目文件。
This commit is contained in:
58
APP/APP_KeypadModel.h
Normal file
58
APP/APP_KeypadModel.h
Normal file
@@ -0,0 +1,58 @@
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QVector>
|
||||
|
||||
namespace APP {
|
||||
|
||||
enum class APP_KeyTone
|
||||
{
|
||||
Normal,
|
||||
Aqua,
|
||||
Amber,
|
||||
Blue
|
||||
};
|
||||
|
||||
struct APP_KeyInfo
|
||||
{
|
||||
QString id;
|
||||
QString label;
|
||||
QString hint;
|
||||
quint16 usage = 0;
|
||||
int row = 0;
|
||||
int column = 0;
|
||||
int rowSpan = 1;
|
||||
int columnSpan = 1;
|
||||
APP_KeyTone tone = APP_KeyTone::Normal;
|
||||
};
|
||||
|
||||
class APP_KeypadModel
|
||||
{
|
||||
public:
|
||||
APP_KeypadModel();
|
||||
|
||||
const QVector<APP_KeyInfo>& App_Func_GetKeyList() const;
|
||||
const QVector<APP_KeyInfo>& App_Func_GetFunctionKeyList() const;
|
||||
bool App_Func_IsLatched(const QString& KeyId) const;
|
||||
bool App_Func_IsPressed(const QString& KeyId) const;
|
||||
quint16 App_Func_GetUsageFromKeyId(const QString& KeyId) const;
|
||||
void App_Func_SetNumLockOn(bool IsOn);
|
||||
void App_Func_ClearPressedKeys();
|
||||
void App_Func_SetPressedKeysFromUsageList(const QVector<quint16>& UsageList);
|
||||
void App_Func_SetSwapUsagePair(quint16 UsageLeft, quint16 UsageRight, bool IsEnabled);
|
||||
|
||||
private:
|
||||
quint16 App_Func_MapUsageForUi(quint16 Usage) const;
|
||||
QString App_Func_GetKeyIdFromUsage(quint16 Usage) const;
|
||||
|
||||
QVector<APP_KeyInfo> appKeyList;
|
||||
QVector<APP_KeyInfo> appFunctionKeyList;
|
||||
QStringList appPressedKeyIdList;
|
||||
bool appNumLockOn = false;
|
||||
bool appIsSwapOn = false;
|
||||
quint16 appSwapUsageLeft = 0;
|
||||
quint16 appSwapUsageRight = 0;
|
||||
};
|
||||
|
||||
} // namespace APP
|
||||
Reference in New Issue
Block a user