📄 mouseinterface.cpp
字号:
// MouseInterface.cpp: implementation of the CMouseInterface class.
//
//////////////////////////////////////////////////////////////////////
#include "MouseInterface.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CMouseInterface::CMouseInterface()
{
m_cPrevPress = 0;
for (int i = 1; i < DEF_MAXRECTS; i++)
m_pRect[i] = NULL;
m_dwTime = timeGetTime();
}
CMouseInterface::~CMouseInterface()
{
for (int i = 1; i < DEF_MAXRECTS; i++)
if (m_pRect[i] != NULL) delete m_pRect[i];
}
void CMouseInterface::AddRect(long sx, long sy, long dx, long dy)
{
for (int i = 1; i < DEF_MAXRECTS; i++)
if (m_pRect[i] == NULL) {
m_pRect[i] = (RECT *) new RECT;
SetRect(m_pRect[i], sx, sy, dx, dy);
return ;
}
}
int CMouseInterface::iGetStatus(int msX, int msY, char cLB, char * pResult)
{
int i, iRet;
if (cLB != 0) {
// 酒流 喘妨柳 滚瓢捞 绝促搁
for (i = 1; i < DEF_MAXRECTS; i++)
if (m_pRect[i] != NULL) {
if ((m_pRect[i]->left < msX) && (m_pRect[i]->right > msX) &&
(m_pRect[i]->top < msY) && (m_pRect[i]->bottom > msY)) {
m_cPrevPress = i;
*pResult = DEF_MIRESULT_PRESS;
return i;
}
}
}
if ((m_cPrevPress != 0) && (cLB == 0)) {
//if (m_cPrevPress <= 0 ) return 0 ;
// 捞傈俊 喘妨柳 滚瓢捞 乐绊 滚瓢捞 都脸促. 努腐登菌绰瘤甫 八荤茄促.
if ((m_pRect[m_cPrevPress]->left < msX) && (m_pRect[m_cPrevPress]->right > msX) &&
(m_pRect[m_cPrevPress]->top < msY) && (m_pRect[m_cPrevPress]->bottom > msY)) {
iRet = m_cPrevPress;
m_cPrevPress = 0;
*pResult = DEF_MIRESULT_CLICK;
return iRet;
}
}
*pResult = DEF_MIRESULT_NONE;
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -