无法让我的应用程序检测“删除"按钮 [英] Unable to get my Application to detect the Delete button

查看:49
本文介绍了无法让我的应用程序检测“删除"按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于这个模糊的问题,我事先表示歉意,但是有人可以给我指出这个问题的指针吗?

I apologize in advance for this vague question but can anyone give me a pointer to this problem?

Delete键在我的应用程序中无法正常工作.例如Delete键在编辑框中不起作用(即,它不会删除突出显示的文本),但Shift Delete确实有效.整个应用程序似乎都是这种情况.我已禁用所有keypreview和OnKey事件,以防它们引起它,但问题仍然存在.

The Delete key does not work as normal in my application. e.g. The Delete key has no effect in an editbox (i.e. it will not delete highlighted text) but Shift Delete does work. This seems to be the case thoughout the application. I have disabled all keypreviews and OnKey events in case they were causing it but the problem persists.

有人可以建议我在哪里寻找问题吗?

Can anyone suggest where I might look for the problem?

运行Windows 10 Delphi 10.3.3

Running Windows 10 Delphi 10.3.3

推荐答案

如果仅在此特定应用程序中发生这种情况,则可能是您有 TActionList TActionManager 使用以 Delete 作为其快捷方式的操作,或带有这种快捷方式的简单菜单项.

If this happens only in this particular application, it is likely that you have a TActionList or TActionManager with an action using Delete as its shortcut, or a simple menu item with such a shortcut.

例如,您可能具有一个 Edit 菜单,其中带有 Clear 项,并使用 Delete 作为其快捷方式:

For instance, you might have an Edit menu with a Clear item using Delete as its shortcut:

然后,该动作或菜单项将对 Delete 做出响应,而不允许集中控制的控件做自己的事情.

Then that action or menu item will respond to Delete, not allowing the focused control to do its own thing.

这种错误非常常见.例如,在Delphi IDE中,您在编辑器上方有一个编辑字段,向您显示当前类:

This kind of mistake is surprisingly common. For instance, in the Delphi IDE, you have an edit field above the editor, showing you the current class:

如果选择此文本并按Ctrl + C,则希望它最终出现在剪贴板中.但不是!相反,即使代码编辑器没有键盘焦点,也将复制代码编辑器中的选定文本(如果有).

If you select this text and press Ctrl+C, you expect it to end up in the clipboard. But no! Instead, the selected text in the code editor (if any) is copied, even though the code editor didn't have keyboard focus.

这篇关于无法让我的应用程序检测“删除"按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆