Repository navigation
GameTrans 1.4.1
GameTrans 1.4.1
本次更新仅涉及热键轮询的实现优化,不改变用户可见的热键行为与配置格式。
变更 / Changes
中文
- 热键轮询由 WPF
DispatcherTimer迁移至专用后台线程(GameTrans.HotkeyPoll,15 ms 间隔,ManualResetEventSlim定时唤醒)。仅在检测到按键按下边沿后通过Dispatcher.BeginInvoke将回调派发至 UI 线程;空闲期间不占用 WPF 消息循环。 - 绑定表改为不可变快照,按键状态与两条通道的时间戳使用
Volatile/Interlocked访问;轮询线程随热键注册启停,退出时通过信号量唤醒并Join。 - 本机实测(Ryzen 9 8945HX / 32 逻辑核)进程空闲 CPU 时间由约 11 ms/s 降至约 3 ms/s。
RegisterHotKey原生通道、GetAsyncKeyState轮询兜底、两通道毫秒级去重、注册失败时的兼容模式提示、模拟键入期间的SuspendFor挂起逻辑均保持不变。
English
- The hotkey polling moved from a WPF
DispatcherTimerto a dedicated background thread (GameTrans.HotkeyPoll, 15 ms interval,ManualResetEventSlim). Callbacks are marshalled to the UI thread viaDispatcher.BeginInvokeonly after a key-down edge; the WPF message loop is not involved while idle. - Bindings are published as immutable snapshots; per-key state and channel timestamps use
Volatile/Interlocked. The polling thread starts and stops with hotkey registration, and is joined on unregistration. - Measured idle process CPU time decreased from about 11 ms/s to about 3 ms/s on the development system (Ryzen 9 8945HX, 32 logical processors).
- The
RegisterHotKeyprimary channel, polling fallback, millisecond-level de-duplication, fallback notification, andSuspendForbehaviour during simulated input are unchanged.
下载 / Download
GameTrans.exe— Windows x64,自包含单文件,无需 .NET 运行时,无需管理员权限。
升级说明 / Upgrade notes
- 配置与 1.4.0 兼容,无需迁移。运行中的旧版本请先从托盘退出,再替换可执行文件。
- 本次未引入新的功能开关或配置字段。
项目主页 / Project: https://github.com/ab-Royo/GameTrans
QQ 群 / QQ group: 419733401
Bilibili: https://m.bilibili.com/space/51952428