按住加速键进行撤消时性能较差

发布于 2024-10-02 13:22:00 字数 221 浏览 0 评论 0原文

我绑定了一个菜单项来调用 jtextpane 上撤消管理器的撤消方法,并为标准 Ctrl-Z 的撤消调用分配了一个“加速器”组合键。撤消的行为正如我所希望的那样,除非我按住 Ctrl-Z。当我这样做时,撤消会以不可预测的节奏执行,通常会冻结 5 秒,然后立即执行一批撤消。我不知道为什么会发生这种情况,因为如果我快速按 Ctrl-Z,它的速度似乎没有限制,这意味着撤消方法不存在内在的性能问题。

I have bound a menu item to invoke the undo method of an undomanager on a jtextpane, and assigned an "accelerator" key combination to that undo invoke of the standard Ctrl-Z. The undo behaves just as I would like it to, unless I hold down Ctrl-Z. When I do that, the undo's are performed at an unpredictable cadence, often freezing for 5 seconds, then doing a batch of undos all at once. I do not know why this is happening, becuase if I rapidly press Ctrl-Z there seems to be no limit to how fast it will go, implying there is no intrinsic performance issue with the undo method.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

微暖i 2024-10-09 13:22:00

难道你把按键重复延迟误认为是“冻结”?

Could it be that you're mistaking the key repeat delay for the "freezing"?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文