61 lines
1.1 KiB
C++
61 lines
1.1 KiB
C++
#include "ChiToLetter.h"
|
|
#include <map>
|
|
#include <set>
|
|
#include <vector>
|
|
|
|
namespace CmdQuery
|
|
{
|
|
struct CmdItem
|
|
{
|
|
CString m_sName;
|
|
CString m_sCmd;
|
|
CString m_sFullLetter;
|
|
CString m_sFirstLetter;
|
|
};
|
|
typedef std::vector<CmdItem> CmdItems;
|
|
|
|
struct CmdQueryItem
|
|
{
|
|
CString m_sFile;
|
|
CString m_sMnuTitle;
|
|
CString m_sGroupName;
|
|
CmdItem m_cmdItem;
|
|
};
|
|
typedef std::vector<CmdQueryItem> CmdQueryItems;
|
|
|
|
struct CmdGroup
|
|
{
|
|
CString m_sGroupName;
|
|
CmdItems m_CmdItems;
|
|
};
|
|
typedef std::vector<CmdGroup> CmdGroups;
|
|
|
|
struct MnuFile
|
|
{
|
|
CString m_sFile;
|
|
CString m_sTitle;
|
|
CmdGroups m_CmdGroups;
|
|
};
|
|
|
|
typedef std::vector<MnuFile> MnuFiles;
|
|
|
|
void findCommand(LPCTSTR pszCmd, CmdQueryItems &items);
|
|
|
|
WPARAM getKeyByChar(LPCTSTR psz);
|
|
|
|
CString getCharByKey(WPARAM key);
|
|
|
|
// 规则:(Ctrl、Alt、Shift)至少有一个.其它字符至少有一个.
|
|
// 不包括(Tab、Caps、Win、Back)
|
|
bool checkHotkey(const std::map<WPARAM, CString> &keys);
|
|
|
|
CString getHotkeyString();
|
|
|
|
void getHotKey(std::set<WPARAM> &hotkeys);
|
|
|
|
void saveHotKey(std::map<WPARAM, CString> &chs);
|
|
|
|
void startHook();
|
|
|
|
void endHook();
|
|
} |