Delphi:如何停止自动重复执行TAction快捷键? [英] Delphi: How do I stop TAction shortcut keys autorepeating?
问题描述
我正在使用带有某些操作快捷键的Delphi TActionList.
I'm using a Delphi TActionList, with Shortcut Keys for some actions.
我想防止某些操作被键盘自动重复触发多次,但我不是要全局影响自动重复操作.最好的方法是什么?
I want to prevent certain actions from being triggered multiple times by keyboard auto-repeat, but I do not want to affect auto-repeat operation globally. What's the best way of doing this?
说明 :我仍然需要处理多个快速按键-我想忽略的只是自动重复生成的按键.
Clarification: I still need to handle multiple fast keypresses - it's only the keypresses generated by auto-repeat that I want to ignore.
推荐答案
拦截 WM_KEYDOWN 消息,然后查看第30位以查看其是否在自动重复.如果是这样,只是不要像往常一样传递消息,就不会看到它.
Intercept the WM_KEYDOWN messages, and look at bit 30 to see if it is auto-repeating. If it is, just don't pass on the message as usual and it will not be seen.
您可能需要启用表单密钥预览才能完成这项工作.
You may need to enable form key-preview to make this work.
这篇关于Delphi:如何停止自动重复执行TAction快捷键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!