X1 — Auto Rotation
While held, moves the mouse smoothly to the right: 20 ms polling with 20 micro-steps.
A general-purpose Windows mouse macro tool — two side-button macros driven by a Win32 SendInput engine behind a global input lock.
AkiMacro is a general-purpose mouse macro tool for Windows 10/11, built with WPF and .NET 10. It binds auto rotation and a two-button combo to your mouse side buttons, executed by a Win32 SendInput engine guarded by a global input lock. It requests UAC elevation automatically and follows an MVVM architecture with unit-testable input abstractions.
While held, moves the mouse smoothly to the right: 20 ms polling with 20 micro-steps.
Left button held, right button tap, release — repeated twice per trigger.
A global input lock (InputLock.SyncRoot) ensures only one Worker simulates input at a time.
Checks for administrator privileges at startup and triggers UAC when not running elevated.
Automatically stops and reports an error when SendInput fails.
IInputSimulator and IButtonStateProvider abstractions support dependency injection and xUnit tests.
Borderless main window with a custom title bar and dark theme, plus About and read-only Settings windows.
| Module | Description |
|---|---|
| Interop | Wraps the Win32 API |
| Input | Input abstraction layer for easy unit testing |
| MacroEngine | Macro execution engine; manages Worker thread lifecycles |
| ViewModels | MVVM pattern, keeping UI and business logic separate |
run.bat to build and launch in one step.dotnet restore dotnet build -c Release dotnet test dotnet publish AkiMacro.csproj -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true
“For learning and entertainment purposes only.”
AkiMacro 是一款面向 Windows 10/11 的通用鼠标宏工具,基于 WPF 与 .NET 10 构建。它将自动旋转与双键组合宏绑定到鼠标侧键,由 Win32 SendInput 引擎执行,并以全局输入锁保障线程安全。程序启动时自动请求 UAC 提权,采用 MVVM 架构,输入层可单元测试。
按住时鼠标平滑向右移动:20ms 轮询,20 个微步。
左键按住 → 右键点按 → 松开,每次触发循环两次。
全局输入锁(InputLock.SyncRoot)确保同一时间只有一个 Worker 模拟输入。
启动时检测管理员权限,非管理员运行时自动触发 UAC。
SendInput 失败时自动停止并上报错误。
IInputSimulator 与 IButtonStateProvider 抽象支持依赖注入与 xUnit 测试。
无边框主窗口配自定义标题栏与深色主题,另含关于窗口与只读设置窗口。
| 模块 | 说明 |
|---|---|
| Interop | 封装 Win32 API |
| Input | 输入抽象层,便于单元测试 |
| MacroEngine | 宏执行引擎,管理 Worker 线程生命周期 |
| ViewModels | MVVM 模式,UI 与业务逻辑分离 |
run.bat 一键构建并启动。dotnet restore dotnet build -c Release dotnet test dotnet publish AkiMacro.csproj -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true
“仅供学习和娱乐使用。”