Improvement: Reduce transmit mouse move message

This commit is contained in:
yuanyuanxiang
2025-07-13 18:34:10 +08:00
parent 92ded3a6c1
commit 7794ef236d
6 changed files with 39 additions and 0 deletions

View File

@@ -759,6 +759,19 @@ void CHideScreenSpyDlg::SendScaledMouseMessage(MSG* pMsg, bool makeLP) {
if (!m_bIsCtrl)
return;
if (pMsg->message == WM_MOUSEMOVE) {
auto now = clock();
auto time_elapsed = now - m_lastMouseMove;
int dx = abs(pMsg->pt.x - m_lastMousePoint.x);
int dy = abs(pMsg->pt.y - m_lastMousePoint.y);
int dist_sq = dx * dx + dy * dy;
if (time_elapsed < 200 && dist_sq < 18 * 18) {
return;
}
m_lastMouseMove = now;
m_lastMousePoint = pMsg->pt;
}
MYMSG msg(*pMsg);
auto low = ((LONG)LOWORD(pMsg->lParam)) * m_wZoom;
auto high = ((LONG)HIWORD(pMsg->lParam)) * m_hZoom;