🟡 [M13] 未检查 KeyEventKind,Press/Repeat/Release 全当命令处理 #23

Closed
opened 2026-06-03 13:53:57 +08:00 by dailz · 1 comment
Owner

文件: tui/main.rs:39
分类: 事件处理

问题: Crossterm 可发送 Press/Repeat/Release 事件,代码未过滤,导致单次按键触发重复滚动/切换/退出。

建议修复: 忽略非 KeyEventKind::Press 事件,仅滚动键处理 Repeat

**文件**: `tui/main.rs:39` **分类**: 事件处理 **问题**: Crossterm 可发送 Press/Repeat/Release 事件,代码未过滤,导致单次按键触发重复滚动/切换/退出。 **建议修复**: 忽略非 `KeyEventKind::Press` 事件,仅滚动键处理 `Repeat`。
dailz added the bugseverity/mediumarea/tui labels 2026-06-03 13:53:57 +08:00
dailz closed this issue 2026-06-10 17:34:24 +08:00
Author
Owner

修复方案: 在 handle_key 入口处统一过滤 KeyEventKind,新增 is_repeatable_key 方法。Release 全部忽略,Repeat 仅白名单键(滚动/导航)通过,Press 全部放行。Commit: 463c531,9个回归测试全部通过。

修复方案: 在 handle_key 入口处统一过滤 KeyEventKind,新增 is_repeatable_key 方法。Release 全部忽略,Repeat 仅白名单键(滚动/导航)通过,Press 全部放行。Commit: 463c531,9个回归测试全部通过。
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dailz/logViewer#23