Skip to content

Commit 4bcaaa1

Browse files
committed
修改鼠标事件未释放的错误
1 parent 1debfe4 commit 4bcaaa1

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/ComputerLock/Platforms/MouseHook.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,8 @@ private void HandleMouseEvent(int wParam)
8484
return;
8585
}
8686

87-
// 只处理鼠标按下和释放事件
88-
if (wParam == WinApi.WM_LBUTTONDOWN || wParam == WinApi.WM_LBUTTONUP ||
89-
wParam == WinApi.WM_RBUTTONDOWN || wParam == WinApi.WM_RBUTTONUP)
87+
// 只处理鼠标按下事件
88+
if (wParam == WinApi.WM_LBUTTONDOWN || wParam == WinApi.WM_RBUTTONDOWN)
9089
{
9190
OnUserInput?.Invoke(this, EventArgs.Empty);
9291
}

src/ComputerLock/Services/GlobalLockService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ private void SystemUnlock()
354354
_logger.Info("系统解锁 -> 恢复鼠标光标");
355355
_mouseHook.ResetCursorState();
356356
}
357-
357+
_mouseHook.Dispose();
358358
_systemKeyHook.Dispose();
359359

360360
if (_cts != null)

0 commit comments

Comments
 (0)