Skip to content

Small but useful update

Latest
Compare
Choose a tag to compare
@RedrootDEV RedrootDEV released this 06 Jun 03:38

Patch Notes

AKC Anti-Keyboard-Chattering – Update Summary
Major Features & Changes

Soft Pause Mode Added:
Introduced "soft pause" mode, allowing you to specify processes that trigger a pause when they are in the foreground window.

Unified Hook Management:
Both "hard" and "soft" pause modes now uninstall the keyboard hook when their respective condition is active, and reinstall it when inactive.
This ensures that no keyboard events are processed by AKC during any pause state.

No More Logic Pausing:
Previously, soft pause only bypassed the chatter filtering logic while keeping the hook installed; now, soft pause fully uninstalls the hook, just like hard pause.

Removed softPaused Flag:
The softPaused variable and all related code have been eliminated, as it is no longer needed in the new design.

Independent Monitoring Intervals:
Added hardPauseMonitorInterval and softPauseMonitorInterval to config.json, allowing you to set separate check intervals for each pause mode (e.g., soft pause can poll quickly, hard pause less often).

Per-Process Pause Mode in Config:
Each process in pauseProcesses now has a mode property ("hard" or "soft"), giving you fine-grained control over how AKC responds to different programs.

Foreground Process Detection Optimized:
The process name for soft pause is now obtained directly via OpenProcess + GetModuleBaseNameW (no longer requires a full process snapshot), resulting in much lower CPU usage when polling frequently.

Robust Concurrency:
Mutexes are used to protect hook installation and pause state, ensuring thread-safe and race-condition-free operation.

Comprehensive Logging:
The log now reflects both soft and hard pause state changes and transitions, including explicit messages when the hook is installed/uninstalled.

Bug Fixes & Cleanups

Fixed previous inefficiency where soft pause would iterate over all processes.

Ensured the hook is never reinstalled while a hard pause is active, even if soft pause changes state.

Cleaned up handler logic—now only checks hardPaused state and system codes.

Removed any unused or obsolete variables and code paths related to previous soft pause logic.

In summary:
AKC now manages both hard and soft pauses by fully uninstalling the keyboard hook, providing maximum isolation and efficiency. The handler code is simpler, monitoring intervals are configurable, and CPU usage is minimized—even with fast polling for soft pause.